Browse Source

Replace missed translations + use % as placeholder delimiter

Following the suggestions from PR #711
Thomas Bruederli 8 years ago
parent
commit
a829bdf1e3

+ 1 - 1
app/Resources/FOSUserBundle/views/Profile/show.html.twig

@@ -14,7 +14,7 @@
             </span>
         </div>
 
-        <p>{{ 'profile.api_token_explain'|trans({ _path_about_:path('about') })|raw }}</p>
+        <p>{{ 'profile.api_token_explain'|trans({ '%path_about%':path('about') })|raw }}</p>
 
         <hr>
     {%- endif %}

+ 14 - 10
src/Packagist/WebBundle/Resources/translations/messages.en.yml

@@ -53,24 +53,28 @@ search:
 packages:
     mine: My packages
     yours: Your packages
-    maintained_by: Packages maintained by _user
+    maintained_by: Packages maintained by %user%
     my_favorites: My favorite packages
-    users_favorites: _user's favorite packages
+    users_favorites: %user%'s favorite packages
     dependent_title: Dependent Packages
     dependents: dependents
-    providers_title: The following packages provide _name_
+    providers_title: The following packages provide %name%
     suggesters: suggesters
     suggesters_title: Suggesters Packages
-    from: Packages from _vendor_
+    from: Packages from %vendor%
 
 browse:
     packages: Packages
+    of_type: of type %type%
+    with_tag: tagged with %tag%
+    join_and: ' and '
+    join_or: ' or '
 
 submit:
     title: Submit package
     submit: Submit
     guide: |
-        <p>Please make sure you have read the package <a href="_path_about_#naming-your-package">naming conventions</a> before submitting your package. The authoritative name of your package will be taken from the composer.json file inside the master branch or trunk of your repository, and it can not be changed after that.</p>
+        <p>Please make sure you have read the package <a href="%path_about%#naming-your-package">naming conventions</a> before submitting your package. The authoritative name of your package will be taken from the composer.json file inside the master branch or trunk of your repository, and it can not be changed after that.</p>
         <p><strong>Do not submit forks of existing packages.</strong> If you need to test changes to a package that you forked to patch, use <a href="https://getcomposer.org/doc/05-repositories.md#vcs">VCS Repositories</a> instead. If however it is a real long-term fork you intend on maintaining feel free to submit it.</p>
         <p>If you need help or if you have any questions please get in touch with the Composer <a href="https://getcomposer.org/doc/07-community.md">community</a>.</p>
 
@@ -83,8 +87,8 @@ abandon:
             will be tagged as abandoned and a replacement can be added later.</p>
 
 edit:
-    page_title: Edit Package _name
-    title: Edit _name
+    page_title: Edit Package %name%
+    title: Edit %name%
     submit: Update
 
 profile:
@@ -94,7 +98,7 @@ profile:
     connect_accounts: Connect accounts
     notify_on_failure: Notify me of package update failures
     api_token_explain: |
-        You can use your API token to interact with the Packagist API, see details in <a href="_path_about_#how-to-update-packages">the docs</a>.
+        You can use your API token to interact with the Packagist API, see details in <a href="%path_about%#how-to-update-packages">the docs</a>.
 
 stats:
     title: Install Statistics
@@ -106,7 +110,7 @@ stats:
     since_midnight: "since midnight, UTC"
     daily: Daily installs
     daily_per_version: Daily installs per version
-    averaged: averaged _avg_
+    averaged: averaged %avg%
 
 statistics:
     title: Statistics
@@ -143,7 +147,7 @@ api_doc:
 
 user:
     member_since: member since
-    packages: _username_'s packages
+    packages: %username%'s packages
 
 'Search packages...': 'Search packages...'
 brandname: Packagist

+ 3 - 3
src/Packagist/WebBundle/Resources/views/Package/browse.html.twig

@@ -2,11 +2,11 @@
 
 {% set filters = [] %}
 
-{% if type %}{% set filters = filters|merge(["of type #{type|join(' or ')}"]) %}{% endif %}
-{% if tag %}{% set filters = filters|merge(["tagged with #{tag|join(' or ')}"]) %}{% endif %}
+{% if type %}{% set filters = filters|merge(['browse.of_type'|trans({ '%type%': type|join('browse.join_or'|trans)})]) %}{% endif %}
+{% if tag %}{% set filters = filters|merge(['browse.with_tag'|trans({ '%tag%': tag|join('browse.join_or'|trans)})]) %}{% endif %}
 
 {% block content_title %}
-    <h1>{{ 'browse.packages'|trans }} {{ filters|join(' and ') }}</h1>
+    <h1>{{ 'browse.packages'|trans }} {{ filters|join('browse.join_and'|trans) }}</h1>
 {% endblock %}
 
 {# TODO:

+ 2 - 2
src/Packagist/WebBundle/Resources/views/Package/edit.html.twig

@@ -1,11 +1,11 @@
 {% extends "PackagistWebBundle::layout.html.twig" %}
 
 {% block title %}
-    {{ 'edit.page_title'|trans({ _name:package.name }) }}
+    {{ 'edit.page_title'|trans({ '%name%':package.name }) }}
 {% endblock %}
 
 {% block content %}
-<h2 class="title">{{ 'edit.title'|trans({ _name:package.name }) }}</h2>
+<h2 class="title">{{ 'edit.title'|trans({ '%name%':package.name }) }}</h2>
 
 <section class="row">
     {{ form_start(form, { attr: { class: 'col-md-6' } }) }}

+ 1 - 1
src/Packagist/WebBundle/Resources/views/Package/providers.html.twig

@@ -1,3 +1,3 @@
 {% extends "PackagistWebBundle:Web:list.html.twig" %}
 
-{% block content_title %}<h1>{{ 'packages.providers_title'|trans({ _name_: name }) }}</h1>{% endblock %}
+{% block content_title %}<h1>{{ 'packages.providers_title'|trans({ '%name%': name }) }}</h1>{% endblock %}

+ 2 - 2
src/Packagist/WebBundle/Resources/views/Package/stats.html.twig

@@ -42,7 +42,7 @@
                 </div>
             </div>
 
-            <h3>{{ 'stats.daily'|trans }}{% if average != 'daily' %}, {{ 'stats.averaged'|trans({ _avg_:average }) }}{% endif %}</h3>
+            <h3>{{ 'stats.daily'|trans }}{% if average != 'daily' %}, {{ 'stats.averaged'|trans({ '%avg%':average }) }}{% endif %}</h3>
             <div class="row">
                 <div class="col-xs-12">
                     <svg class="chart js-all-dls" width="500" height="200">
@@ -52,7 +52,7 @@
             </div>
 
             <br>
-            <h3>{{ 'stats.daily_per_version'|trans }}{% if average != 'daily' %}, {{ 'stats.averaged'|trans({ _avg_:average }) }}{% endif %}</h3>
+            <h3>{{ 'stats.daily_per_version'|trans }}{% if average != 'daily' %}, {{ 'stats.averaged'|trans({ '%avg%':average }) }}{% endif %}</h3>
             <div class="row package version-stats">
                 <div class="col-xs-12 col-md-9 version-stats-chart">
                     <div style="position: relative">

+ 1 - 1
src/Packagist/WebBundle/Resources/views/Package/submitPackage.html.twig

@@ -19,7 +19,7 @@
     {{ form_end(form) }}
 
     <div class="col-md-6">
-        {{ 'submit.guide'|trans({ _path_about_: path('about') })|raw }}
+        {{ 'submit.guide'|trans({ '%path_about%': path('about') })|raw }}
     </div>
 </section>
 {% endblock %}

+ 1 - 1
src/Packagist/WebBundle/Resources/views/Package/viewVendor.html.twig

@@ -5,4 +5,4 @@
     {{ parent() }}
 {% endblock %}
 
-{% block content_title %}<h1>{{ 'packages.from'|trans({ _vendor_:vendor }) }}</h1>{% endblock %}
+{% block content_title %}<h1>{{ 'packages.from'|trans({ '%vendor%':vendor }) }}</h1>{% endblock %}

+ 1 - 1
src/Packagist/WebBundle/Resources/views/User/favorites.html.twig

@@ -27,7 +27,7 @@
     <section class="{{ isActualUser ? 'col-md-9' : 'col-md-12' }}">
         {% embed "PackagistWebBundle:Web:list.html.twig" with {noLayout: 'true', showAutoUpdateWarning: isActualUser} %}
             {% block content_title %}
-                <h3 class="font-normal profile-title">{{ (isActualUser ? 'packages.my_favorites' : 'packages.users_favorites')|trans({ _user: user.username }) }}</h3>
+                <h3 class="font-normal profile-title">{{ (isActualUser ? 'packages.my_favorites' : 'packages.users_favorites')|trans({ '%user%': user.username }) }}</h3>
             {% endblock %}
         {% endembed %}
     </section>

+ 1 - 1
src/Packagist/WebBundle/Resources/views/User/packages.html.twig

@@ -27,7 +27,7 @@
     <section class="{{ isActualUser ? 'col-md-9' : 'col-md-12' }}">
         {% embed "PackagistWebBundle:Web:list.html.twig" with {noLayout: 'true', showAutoUpdateWarning: isActualUser} %}
             {% block content_title %}
-                <h3 class="font-normal profile-title">{{ (isActualUser ? 'packages.mine' : 'packages.maintained:by')|trans({ _user: user.username }) }}</h3>
+                <h3 class="font-normal profile-title">{{ (isActualUser ? 'packages.mine' : 'packages.maintained_by')|trans({ '%user%': user.username }) }}</h3>
             {% endblock %}
         {% endembed %}
     </section>

+ 1 - 1
src/Packagist/WebBundle/Resources/views/User/profile.html.twig

@@ -19,7 +19,7 @@
     <section class="col-md-12">
         {% embed "PackagistWebBundle:Web:list.html.twig" with {noLayout: 'true', showAutoUpdateWarning: isActualUser} %}
             {% block content_title %}
-                <h3 class="font-normal profile-title">{{ 'user.packages'|trans({ _username_:user.username }) }}</h3>
+                <h3 class="font-normal profile-title">{{ 'user.packages'|trans({ '%username%':user.username }) }}</h3>
             {% endblock %}
         {% endembed %}
     </section>