mirror of
https://github.com/gosticks/PiPer.git
synced 2026-07-04 23:20:02 +00:00
Added localization module
This commit is contained in:
Binary file not shown.
19
src/common/scripts/localization.js
Normal file
19
src/common/scripts/localization.js
Normal 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,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
|
||||
*
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user