i18n hook for main gt.html

merge-requests/138/merge
christian 2021-06-09 21:29:23 -04:00
rodzic 7e9e5b9cfe
commit 9d31645823
2 zmienionych plików z 41 dodań i 17 usunięć

Wyświetl plik

@ -46,6 +46,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<script src="./lib/moment-timezone-with-data.js" type="text/javascript"></script>
<script src="./lib/datepicker.js"></script>
<script src="./lib/callsigns.js" type="text/javascript"></script>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<script src="./lib/CLDRPluralRuleParser/src/CLDRPluralRuleParser.js"></script>
<!-- Source -->
<script src="./lib/jquery.i18n.js"></script>
<script src="./lib/jquery.i18n.messagestore.js"></script>
<script src="./lib/jquery.i18n.fallbacks.js"></script>
<script src="./lib/jquery.i18n.parser.js"></script>
<script src="./lib/jquery.i18n.emitter.js"></script>
<script src="./lib/jquery.i18n.language.js"></script>
<script src="./lib/shadow.js" type="text/javascript"></script>
<script src="./lib/gtws.js" type="text/javascript"></script>
<script src="./lib/gt.js" type="text/javascript"></script>
@ -482,7 +494,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>
<table align="center">
<tr>
<td colspan="2">Map View Filters</td>
<td colspan="2" data-i18n="map-view-filters">Map View Filters</td>
</tr>
<tr title="Select Band&#10;(Auto tracks WSJT-X)">

Wyświetl plik

@ -5,26 +5,11 @@ const pjson = require("./package.json");
var gtVersion = parseInt(pjson.version.replace(/\./g, ""));
var gtBeta = pjson.betaVersion;
var banana = require('../../node_modules/banana-i18n/dist/banana-i18n.js');
var g_startVersion = 0;
if (typeof localStorage.currentVersion != "undefined")
{ g_startVersion = localStorage.currentVersion; }
// const messages = {
// 'en': {
// 'appname-sub-title': 'Example Application'
// },
// 'ru' : {
// 'appname-sub-title': 'Демонстрационное приложение'
// },
// 'zn' : {
// 'appname-sub-title': '业余无线电数据通信助手'
// }
// };
// const banana = new Banana('en');
// banana.load(messages);
if (
typeof localStorage.currentVersion == "undefined" ||
localStorage.currentVersion != String(gtVersion)
@ -13772,6 +13757,33 @@ function postInit()
openCallRosterWindow(false);
openConditionsWindow(false);
showMessaging(false);
renderI18n();
}
function renderI18n()
{
const messages = {
'en': {
'appname-sub-title': 'Example Application',
'map-view-filters': 'maps'
},
'ru' : {
'appname-sub-title': 'Демонстрационное приложение',
'map-view-filters': 'Демонстрационное'
},
'zn' : {
'appname-sub-title': '业余无线电数据通信助手',
'map-view-filters': '业余无线电数据通信助手'
}
};
$.i18n( {
locale: 'ru'
} );
$.i18n().load( messages );
$('body').i18n();
}
document.addEventListener("dragover", function (event)