Skip to content

Commit

Permalink
Fix to "missing translation" error + typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric committed Feb 19, 2022
1 parent 8e3ecfd commit 4d524d1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Shortcuts/firebase/functions/inc/shortcut.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ module.exports = function(info, errors)
<p class="lang" data-lang="main.accountSelector.info">This corresponds to the position of your Google account in the list of connected accounts.&#8203;<br/>&#8203;Check the bubble in the top-right corner of &#8203;<a href="https://google.com">google.com</a>&#8203; to see this list.</p>
<p><label class="clickable"><input type="checkbox" id="AccountIDCookieConfirm"> <span class="lang" data-lang="main.accountSelector.confirm"><em>In order to store your account ID, this will register the number you have picked as a cookie in your browser. It will not be used for tracking purposes.</em></span></label></p>
<p>
<button id="AccountSelectorButton" class="langTitle" data-langtitle="main.accountSelector.confirmButtonTitleAttr" title="Save your prefered Googla account ID as a Cookie." disabled>
<button id="AccountSelectorButton" class="langTitle" data-langtitle="main.accountSelector.confirmButtonTitleAttr" title="Save your prefered Google account ID as a Cookie." disabled>
<span class="lang" data-lang="main.accountSelector.confirmButton">Save</span>
</button>
<button class="closeAccountSelector outline">
Expand Down
2 changes: 1 addition & 1 deletion Shortcuts/firebase/public/lang/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"info": "This corresponds to the position of your Google account in the list of connected accounts.{0}Check the bubble in the top-right corner of {1} to see this list.",
"confirm": "In order to store your account ID, this will register the number you have picked as a cookie in your browser. It will not be used for tracking purposes.",
"confirmButton": "Save",
"confirmButtonTitleAttr": "Save your prefered Googla account ID as a Cookie."
"confirmButtonTitleAttr": "Save your prefered Google account ID as a Cookie."
},
"alert":
{
Expand Down
24 changes: 16 additions & 8 deletions Shortcuts/firebase/public/scripts/lang.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,12 @@ function TranslateHtml(data)
{
if (elems && elems.length > 0)
{
//console.log('%cStadiaIcons', 'display: inline-block; padding: 0em 0.2em; font-size: 1.08em; border-radius: 0.2em; font-weight: 900; -webkit-linear-gradient(107deg,#ff4c1d,#9b0063); background: linear-gradient(107deg,#ff4c1d,#9b0063); font-family:"Google Sans","Product Sans","Roboto",sans-serif;', 'Translation Error: target not found for ', 'Translating {', objs[i].innerHTML, '} into {', target.format(elems), '} using these elements: ', elems);
//console.log('%cStadiaIcons', 'display: inline-block; padding: 0em 0.2em; font-size: 1.08em; border-radius: 0.2em; font-weight: 900; -webkit-linear-gradient(107deg,#ff4c1d,#9b0063); background: linear-gradient(107deg,#ff4c1d,#9b0063); font-family:"Google Sans","Product Sans","Roboto",sans-serif;', 'Translating {', objs[i].innerHTML, '} into {', target.format(elems), '} using these elements: ', elems);
objs[i].innerHTML = target.format(elems);
}
else
{
//console.log('%cStadiaIcons', 'display: inline-block; padding: 0em 0.2em; font-size: 1.08em; border-radius: 0.2em; font-weight: 900; -webkit-linear-gradient(107deg,#ff4c1d,#9b0063); background: linear-gradient(107deg,#ff4c1d,#9b0063); font-family:"Google Sans","Product Sans","Roboto",sans-serif;', 'Translation Error: target not found for ', 'Translating {', objs[i].innerHTML, '} into {', target, '}.');
//console.log('%cStadiaIcons', 'display: inline-block; padding: 0em 0.2em; font-size: 1.08em; border-radius: 0.2em; font-weight: 900; -webkit-linear-gradient(107deg,#ff4c1d,#9b0063); background: linear-gradient(107deg,#ff4c1d,#9b0063); font-family:"Google Sans","Product Sans","Roboto",sans-serif;', 'Translating {', objs[i].innerHTML, '} into {', target, '}.');
objs[i].innerHTML = target;
}
}
Expand All @@ -253,12 +253,12 @@ function TranslateTitles( data )
{
if ( elems && elems.length > 0 )
{
//console.log('%cStadiaIcons', 'display: inline-block; padding: 0em 0.2em; font-size: 1.08em; border-radius: 0.2em; font-weight: 900; -webkit-linear-gradient(107deg,#ff4c1d,#9b0063); background: linear-gradient(107deg,#ff4c1d,#9b0063); font-family:"Google Sans","Product Sans","Roboto",sans-serif;', 'Translation Error: target not found for ', 'Translating {', objs[i].title, '} into {', target.format(elems), '} using these elements: ', elems);
//console.log('%cStadiaIcons', 'display: inline-block; padding: 0em 0.2em; font-size: 1.08em; border-radius: 0.2em; font-weight: 900; -webkit-linear-gradient(107deg,#ff4c1d,#9b0063); background: linear-gradient(107deg,#ff4c1d,#9b0063); font-family:"Google Sans","Product Sans","Roboto",sans-serif;', 'Translating {', objs[i].title, '} into {', target.format(elems), '} using these elements: ', elems);
objs[i].title = target.format( elems );
}
else
{
//console.log('%cStadiaIcons', 'display: inline-block; padding: 0em 0.2em; font-size: 1.08em; border-radius: 0.2em; font-weight: 900; -webkit-linear-gradient(107deg,#ff4c1d,#9b0063); background: linear-gradient(107deg,#ff4c1d,#9b0063); font-family:"Google Sans","Product Sans","Roboto",sans-serif;', 'Translation Error: target not found for ', 'Translating {', objs[i].title, '} into {', target, '}.');
//console.log('%cStadiaIcons', 'display: inline-block; padding: 0em 0.2em; font-size: 1.08em; border-radius: 0.2em; font-weight: 900; -webkit-linear-gradient(107deg,#ff4c1d,#9b0063); background: linear-gradient(107deg,#ff4c1d,#9b0063); font-family:"Google Sans","Product Sans","Roboto",sans-serif;', 'Translating {', objs[i].title, '} into {', target, '}.');
objs[i].title = target;
}
}
Expand Down Expand Up @@ -310,12 +310,20 @@ function GetLangString(pathString, data)
{
const path = pathString.split( '.' );
var target = data;
for (p in path)

try
{
target = target[path[p]];
for ( p in path )
{
target = target[path[p]];
}
return target;
}
catch ( err )
{
//console.log( '%cStadiaIcons', 'display: inline-block; padding: 0em 0.2em; font-size: 1.08em; border-radius: 0.2em; font-weight: 900; -webkit-linear-gradient(107deg,#ff4c1d,#9b0063); background: linear-gradient(107deg,#ff4c1d,#9b0063); font-family:"Google Sans","Product Sans","Roboto",sans-serif;', 'Translation Error: target not found for [' + pathString + '] using these elements:', data );
return false;
}
return target;
}


Expand Down

0 comments on commit 4d524d1

Please sign in to comment.