Browse Source

gui: Improve Latest Change translation string for better multilanguage support (#8290)

Currently, the "Latest Change" translation string is hard-coded to use
the English-like word order of V ("deleted") + N ("file"). As such, it
is incompatible with languages that require to use a different word
order, e.g. Korean or Japanese. In other words, a proper translation of
the string to those languages is currently impossible.

This commit changes the translation string, so that it includes the file
variable, and thanks to this, it can be easily adopted to languages with
different word order than English.

Signed-off-by: Tomasz Wilczyński <[email protected]>
tomasz1986 3 years ago
parent
commit
4893513800
2 changed files with 4 additions and 5 deletions
  1. 2 2
      gui/default/assets/lang/lang-en.json
  2. 2 3
      gui/default/index.html

+ 2 - 2
gui/default/assets/lang/lang-en.json

@@ -78,7 +78,7 @@
    "Defaults": "Defaults",
    "Delete": "Delete",
    "Delete Unexpected Items": "Delete Unexpected Items",
-   "Deleted": "Deleted",
+   "Deleted {%file%}": "Deleted {{file}}",
    "Deselect All": "Deselect All",
    "Deselect devices to stop sharing this folder with.": "Deselect devices to stop sharing this folder with.",
    "Deselect folders to stop sharing with this device.": "Deselect folders to stop sharing with this device.",
@@ -409,7 +409,7 @@
    "Unshared Folders": "Unshared Folders",
    "Untrusted": "Untrusted",
    "Up to Date": "Up to Date",
-   "Updated": "Updated",
+   "Updated {%file%}": "Updated {{file}}",
    "Upgrade": "Upgrade",
    "Upgrade To {%version%}": "Upgrade To {{version}}",
    "Upgrading": "Upgrading",

+ 2 - 3
gui/default/index.html

@@ -547,9 +547,8 @@
                         <th><span class="fas fa-fw fa-exchange-alt"></span>&nbsp;<span translate>Latest Change</span></th>
                         <td class="text-right">
                           <span tooltip data-original-title="{{folderStats[folder.id].lastFile.filename}} @ {{folderStats[folder.id].lastFile.at | date:'yyyy-MM-dd HH:mm:ss'}}">
-                            <span translate ng-if="!folderStats[folder.id].lastFile.deleted">Updated</span>
-                            <span translate ng-if="folderStats[folder.id].lastFile.deleted">Deleted</span>
-                            {{folderStats[folder.id].lastFile.filename | basename}}
+                            <span translate translate-value-file="{{folderStats[folder.id].lastFile.filename | basename}}" ng-if="!folderStats[folder.id].lastFile.deleted">Updated {%file%}</span>
+                            <span translate translate-value-file="{{folderStats[folder.id].lastFile.filename | basename}}" ng-if="folderStats[folder.id].lastFile.deleted">Deleted {%file%}</span>
                           </span>
                         </td>
                       </tr>