Added localization module

This commit is contained in:
amarcu5
2018-11-11 15:00:06 +00:00
parent f8aaf5204b
commit fcd4ce68c4
4 changed files with 21 additions and 21 deletions
Binary file not shown.
+19
View File
@@ -0,0 +1,19 @@
/**
* Returns localized button title
*
* @return {string}
*/
export const localizedButtonTitle = function() {
const language = navigator.language.substring(0, 2);
switch (language) {
case 'de':
return 'Bild-in-Bild starten';
case 'nl':
return 'Beeld in beeld starten';
case 'fr':
return 'Démarrer Image dans l’image';
case 'en':
default:
return 'Open Picture in Picture mode';
}
};
+1 -20
View File
@@ -1,4 +1,5 @@
import { info, error } from './logger.js'
import { localizedButtonTitle } from './localization.js'
/**
* @typedef {{
@@ -28,26 +29,6 @@ let /** boolean */ showingCaptions = false;
let /** boolean */ showingEmptyCaption = false;
let /** string */ lastUnprocessedCaption = '';
/**
* Returns localized button title
*
* @return {string}
*/
const localizedButtonTitle = function() {
const language = navigator.language.substring(0, 2);
switch (language) {
case 'de':
return 'Bild-in-Bild starten';
case 'nl':
return 'Beeld in beeld starten';
case 'fr':
return 'Démarrer Image dans l’image';
case 'en':
default:
return 'Open Picture in Picture mode';
}
};
/**
* Injects Picture in Picture button into webpage
*
+1 -1
View File
@@ -10,7 +10,7 @@
<key>CFBundleShortVersionString</key>
<string></string>
<key>CFBundleVersion</key>
<string>162</string>
<string>163</string>
<key>Developer Identifier</key>
<string>BQ6Q24MF9X</string>
<key>URL</key>