Finalizing the translation system
This commit is contained in:
parent
6e82161334
commit
75dd6d716c
21 changed files with 31 additions and 15 deletions
|
@ -7,8 +7,8 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"compile-sass": "sass --update .:.",
|
"compile-sass": "sass --update .:.",
|
||||||
"build-worker": "tsc -p shared/js/workers/tsconfig_worker_codec.json",
|
"build-worker": "tsc -p shared/js/workers/tsconfig_worker_codec.json",
|
||||||
"dtsgen": "node build/dtsgen/index.js",
|
"dtsgen": "node tools/dtsgen/index.js",
|
||||||
"trgen": "node build/trgen/index.js",
|
"trgen": "node tools/trgen/index.js",
|
||||||
"ttsc": "ttsc"
|
"ttsc": "ttsc"
|
||||||
},
|
},
|
||||||
"author": "TeaSpeak (WolverinDEV)",
|
"author": "TeaSpeak (WolverinDEV)",
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
<div class="btn_away_toggle"><div class="icon client-away"></div><a>{{tr "Toggle away status" /}}</a></div>
|
<div class="btn_away_toggle"><div class="icon client-away"></div><a>{{tr "Toggle away status" /}}</a></div>
|
||||||
<div class="btn_away_message"><div class="icon client-away"></div><a>{{ŧr "Set away message" /}}</a></div>
|
<div class="btn_away_message"><div class="icon client-away"></div><a>{{tr "Set away message" /}}</a></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="button btn_mute_input">
|
<div class="button btn_mute_input">
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"info": {
|
"info": {
|
||||||
"name": "Auto translated messages for language de by the google translator",
|
"name": "German translation, based on Google Translate",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
{
|
{
|
||||||
"name": "Google Translate, via script by Markus Hadenfeldt",
|
"name": "Google Translate, via script by Markus Hadenfeldt",
|
||||||
|
@ -23,9 +23,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"translated": "Klingt initialisiert",
|
"translated": "Audios initialisiert",
|
||||||
"flags": [
|
"flags": [
|
||||||
"google-translate"
|
"google-translate",
|
||||||
|
"human-modified"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"message": "Sounds initialitzed"
|
"message": "Sounds initialitzed"
|
||||||
|
@ -2291,9 +2292,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"translated": "die Einstellungen",
|
"translated": "Einstellungen",
|
||||||
"flags": [
|
"flags": [
|
||||||
"google-translate"
|
"google-translate",
|
||||||
|
"human-modified"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"message": "Settings"
|
"message": "Settings"
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
{
|
{
|
||||||
"translations": [
|
"translations": [
|
||||||
{
|
|
||||||
"key": "de_DE",
|
|
||||||
"path": "de_DE.translation"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"key": "de_DE_gt",
|
"key": "de_DE_gt",
|
||||||
"path": "de_DE_google_translate.translation"
|
"path": "de_DE_google_translate.translation"
|
||||||
|
|
|
@ -71,7 +71,7 @@ namespace i18n {
|
||||||
const sloppy = fast_translate[message];
|
const sloppy = fast_translate[message];
|
||||||
if(sloppy) return sloppy;
|
if(sloppy) return sloppy;
|
||||||
|
|
||||||
console.log("Translating \"%s\". Default: \"%s\"", key, message);
|
log.info(LogCategory.I18N, "Translating \"%s\". Default: \"%s\"", key, message);
|
||||||
|
|
||||||
let translated = message;
|
let translated = message;
|
||||||
for(const translation of translations) {
|
for(const translation of translations) {
|
||||||
|
@ -92,7 +92,6 @@ namespace i18n {
|
||||||
async: true,
|
async: true,
|
||||||
success: result => {
|
success: result => {
|
||||||
try {
|
try {
|
||||||
console.dir(result);
|
|
||||||
const file = (typeof(result) === "string" ? JSON.parse(result) : result) as TranslationFile;
|
const file = (typeof(result) === "string" ? JSON.parse(result) : result) as TranslationFile;
|
||||||
if(!file) {
|
if(!file) {
|
||||||
reject("Invalid json");
|
reject("Invalid json");
|
||||||
|
@ -191,6 +190,16 @@ namespace i18n {
|
||||||
for(const repo of config.repositories)
|
for(const repo of config.repositories)
|
||||||
(repo.repository || {load_timestamp: 0}).load_timestamp = 0;
|
(repo.repository || {load_timestamp: 0}).load_timestamp = 0;
|
||||||
|
|
||||||
|
if(config.repositories.length == 0) {
|
||||||
|
//Add the default TeaSpeak repository
|
||||||
|
load_repository(settings.static("i18n.default_repository", "i18n/")).then(repo => {
|
||||||
|
log.info(LogCategory.I18N, tr("Successfully added default repository from \"%s\"."), repo.url);
|
||||||
|
register_repository(repo);
|
||||||
|
}).catch(error => {
|
||||||
|
log.warn(LogCategory.I18N, tr("Failed to add default repository. Error: %o"), error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return _cached_repository_config = config;
|
return _cached_repository_config = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,7 +251,6 @@ namespace i18n {
|
||||||
export function iterate_translations(callback_entry: (repository: TranslationRepository, entry: TranslationFile) => any, callback_finish: () => any) {
|
export function iterate_translations(callback_entry: (repository: TranslationRepository, entry: TranslationFile) => any, callback_finish: () => any) {
|
||||||
let count = 0;
|
let count = 0;
|
||||||
const update_finish = () => {
|
const update_finish = () => {
|
||||||
console.error(count);
|
|
||||||
if(count == 0 && callback_finish)
|
if(count == 0 && callback_finish)
|
||||||
callback_finish();
|
callback_finish();
|
||||||
};
|
};
|
||||||
|
|
10
tools/trmanager/index.html
Normal file
10
tools/trmanager/index.html
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Translation Manager</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div>This needs some improvements</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Add table
Reference in a new issue