Fix style header localization

This commit is contained in:
Rob Garrison 2018-12-15 08:55:51 -06:00
parent 596d6a9ca9
commit 42a75780d5
3 changed files with 28 additions and 6 deletions

View File

@ -1257,12 +1257,32 @@
"shortcutsNote": { "shortcutsNote": {
"message": "Define keyboard shortcuts" "message": "Define keyboard shortcuts"
}, },
"sortColumnInjection": {
"message": "injection order",
"description": "Column name seen in the tooltip when hovering over the header; used to replace the 'sortLabel` placeholder"
},
"sortColumnEnabled": {
"message": "enabled styles",
"description": "Column name seen in the tooltip when hovering over the header; used to replace the 'sortLabel` placeholder"
},
"sortColumnName": {
"message": "style name",
"description": "Column name seen in the tooltip when hovering over the header; used to replace the 'sortLabel` placeholder"
},
"sortColumnVersion": {
"message": "style version",
"description": "Column name seen in the tooltip when hovering over the header; used to replace the 'sortLabel` placeholder"
},
"sortColumnLastUpdate": {
"message": "last updated",
"description": "Column name seen in the tooltip when hovering over the header; used to replace the 'sortLabel` placeholder"
},
"sortHeader": { "sortHeader": {
"message": "Sort", "message": "Sort",
"description": "Title of sort column, indicating that the style can be manually sorted by dragging & dropping" "description": "Title of sort column, indicating that the style can be manually sorted by dragging & dropping"
}, },
"sortLabel": { "sortLabel": {
"message": "Click to sort by \"$name$\";\nUse shift + click to sort by multiple items", "message": "Click to sort the \"$name$\" column;\nUse shift + click to sort multiple columns",
"placeholders": { "placeholders": {
"name": { "name": {
"content": "$1" "content": "$1"

View File

@ -9,6 +9,8 @@ tDocLoader();
function t(key, params) { function t(key, params) {
if (!params && key.includes(';')) { if (!params && key.includes(';')) {
[key, params] = key.split(';'); [key, params] = key.split(';');
// sometimes a param like "usercss" is passed; not defined in messages.json
params = params ? chrome.i18n.getMessage(params) || params : '';
} }
const cache = !params && t.cache[key]; const cache = !params && t.cache[key];
const s = cache || chrome.i18n.getMessage(key, params); const s = cache || chrome.i18n.getMessage(key, params);

View File

@ -397,19 +397,19 @@
</svg> </svg>
</div> </div>
<div class="entry-col header-id"> <div class="entry-col header-id">
<a href="#" class="sortable tt-se" data-type="order" i18n-data-title="sortLabel;injection order">#<span></span></a> <a href="#" class="sortable tt-se" data-type="order" i18n-data-title="sortLabel;sortColumnInjection">#<span></span></a>
</div> </div>
<a href="#" class="entry-col sortable header-state center-text tt-se" i18n-text="genericEnabledLabel" i18n-data-title="sortLabel;enabled styles" data-type="disabled"><span></span></a> <a href="#" class="entry-col sortable header-state center-text tt-se" i18n-text="genericEnabledLabel" i18n-data-title="sortLabel;sortColumnEnabled" data-type="disabled"><span></span></a>
<div class="entry-col header-name"> <div class="entry-col header-name">
<a href="#" class="sortable tt-se" i18n-text="genericName" i18n-data-title="sortLabel;style name" data-type="title"><span></span></a> <a href="#" class="sortable tt-se" i18n-text="genericName" i18n-data-title="sortLabel;sortColumnName" data-type="title"><span></span></a>
</div> </div>
<div class="entry-col header-actions" i18n-text="optionsActions"></div> <div class="entry-col header-actions" i18n-text="optionsActions"></div>
<div class="entry-col header-sort center-text tt-sw" i18n-text="sortHeader" i18n-data-title="sortHeaderOrderLabel"></div> <div class="entry-col header-sort center-text tt-sw" i18n-text="sortHeader" i18n-data-title="sortHeaderOrderLabel"></div>
<div class="entry-col header-version"> <div class="entry-col header-version">
<a href="#" class="sortable tt-sw" i18n-data-title="sortLabel;style version" data-type="version">v#<span></span></a> <a href="#" class="sortable tt-sw" i18n-data-title="sortLabel;sortColumnVersion" data-type="version">v#<span></span></a>
</div> </div>
<div class="entry-col header-last-update center-text"> <div class="entry-col header-last-update center-text">
<a href="#" class="entry-col sortable tt-sw" i18n-text="searchResultUpdated" i18n-data-title="sortLabel;last updated" data-type="dateUpdated"><span></span></a> <a href="#" class="entry-col sortable tt-sw" i18n-text="searchResultUpdated" i18n-data-title="sortLabel;sortColumnLastUpdate" data-type="dateUpdated"><span></span></a>
<a href="#" id="update-history" class="tt-sw" i18n-data-title="genericHistoryLabel" tabindex="0"> <a href="#" id="update-history" class="tt-sw" i18n-data-title="genericHistoryLabel" tabindex="0">
<svg class="svg-icon" viewBox="0 0 20 20" i18n-alt="helpAlt"> <svg class="svg-icon" viewBox="0 0 20 20" i18n-alt="helpAlt">
<path d="M13,7H7V6h6Zm6,6.5A5.5,5.5,0,0,1,8.61,16H4V3H16V8.61A5.5,5.5,0,0,1,19,13.5ZM8,14c0-.16,0-.84,0-1H7V12H8.21a5.46,5.46,0,0,1,.39-1H7V10H9.26a5.55,5.55,0,0,1,1.09-1H7V8h7V5H6v9Zm10-.5A4.5,4.5,0,1,0,13.5,18,4.5,4.5,0,0,0,18,13.5ZM14,13V10H13v4h4V13Z"/> <path d="M13,7H7V6h6Zm6,6.5A5.5,5.5,0,0,1,8.61,16H4V3H16V8.61A5.5,5.5,0,0,1,19,13.5ZM8,14c0-.16,0-.84,0-1H7V12H8.21a5.46,5.46,0,0,1,.39-1H7V10H9.26a5.55,5.55,0,0,1,1.09-1H7V8h7V5H6v9Zm10-.5A4.5,4.5,0,1,0,13.5,18,4.5,4.5,0,0,0,18,13.5ZM14,13V10H13v4h4V13Z"/>