#79 start, and fix translation load when first run

This commit is contained in:
UKDTOM 2020-08-09 19:37:24 +02:00
parent 268b530f75
commit ce5f80e728
6 changed files with 114 additions and 116 deletions

2
.gitignore vendored
View file

@ -21,4 +21,4 @@ yarn-error.log*
*.sw? *.sw?
#Electron-builder output #Electron-builder output
/dist_electron /dist_electron*

View file

@ -1,8 +1,6 @@
{ {
"Common":{ "Common":{
"AppName":"WebTools-NG", "AppName":"WebTools-NG",
"SelServer": "Select Server",
"Ok": "OK",
"Home":{ "Home":{
"About":"@:Common.AppName is a tool that enables the use of tool modules to help with Plex Server management.", "About":"@:Common.AppName is a tool that enables the use of tool modules to help with Plex Server management.",
"Modules":"Tool modules currently available are:", "Modules":"Tool modules currently available are:",
@ -20,10 +18,11 @@
"Note":"3.Party Auth is not supported!", "Note":"3.Party Auth is not supported!",
"Username":"Username", "Username":"Username",
"UsernamePrompt":"Enter your plex.tv Username", "UsernamePrompt":"Enter your plex.tv Username",
"UsernameSave": "Remember Username",
"Password":"Password", "Password":"Password",
"PasswordPrompt": "Enter your plex.tv password" "PasswordPrompt":"Enter your plex.tv password",
"UsernameSave":"Remember Username"
}, },
"SelServer":"Select Server",
"Menu":{ "Menu":{
"File":{ "File":{
"menuFile":"File", "menuFile":"File",
@ -60,15 +59,14 @@
"ET":{ "ET":{
"Settings":"Settings" "Settings":"Settings"
} }
}
} }
}, },
"Ok":"OK"
},
"Modules":{ "Modules":{
"ET":{ "ET":{
"Description":"@:Modules.ET.Name allows you to export some information about the medias in your libraries", "Description":"@:Modules.ET.Name allows you to export some information about the medias in your libraries",
"Name":"ExportTool", "Name":"ExportTool",
"ErrorServer": "No server",
"HSelectMedia":"Select Media Type", "HSelectMedia":"Select Media Type",
"HSelectSelection":"Select Media Libary", "HSelectSelection":"Select Media Libary",
"SelectSelection":"Select Selection", "SelectSelection":"Select Selection",
@ -78,26 +76,9 @@
"RadioMusic":"Music", "RadioMusic":"Music",
"RadioPhotos":"Photos", "RadioPhotos":"Photos",
"RadioOtherVideos":"Other Videos", "RadioOtherVideos":"Other Videos",
"ErrorServer":"No server",
"ErrorNoServerSelected":"No server selected", "ErrorNoServerSelected":"No server selected",
"LevelInfo": "Export level determines what data is going to be exported.", "Settings":{
"ExportLevel": "Export Level",
"SelectLevel": "Select level",
"BuildInLevels": "*** Buildin levels ***",
"CustomLevels": "*** Custom levels ***",
"NoLevelFound": "N/A",
"TT-ETType": "Here you select the type of library you want to export",
"TT-ETLibrary": "Here you select library you want to export",
"TT-ETLevel": "Here you select the values you want to export",
"Status":{
"StartExport": "Starting to Export",
"GetSectionItems": "Initial fetching items of {idx} in chuncks of {chunck}",
"Idle": "Idle",
"Status": "Status: ",
"Processing-Chunk": "Processing chunk {current} of {total}",
"Processing-Chunk-Detailed": "Processing chunk {current} of {total}.\nItems to export: {urlStr}"
},
"Settings":
{
"Settings":"Settings", "Settings":"Settings",
"Description":"Here you can define the settings for @:Modules.ET.Name", "Description":"Here you can define the settings for @:Modules.ET.Name",
"Browse":"Browse", "Browse":"Browse",
@ -109,6 +90,23 @@
"SortTitleNull":"Default Sort title to title, if empty", "SortTitleNull":"Default Sort title to title, if empty",
"AutoXLSCol":"Autosize column (xlsx only)", "AutoXLSCol":"Autosize column (xlsx only)",
"AutoXLSRow":"Autosize row (xlsx only)" "AutoXLSRow":"Autosize row (xlsx only)"
},
"LevelInfo":"Export level determines what data is going to be exported.",
"ExportLevel":"Export Level",
"SelectLevel":"Select level",
"BuildInLevels":"*** Buildin levels ***",
"CustomLevels":"*** Custom levels ***",
"NoLevelFound":"N/A",
"TT-ETType":"Here you select the type of library you want to export",
"TT-ETLibrary":"Here you select library you want to export",
"TT-ETLevel":"Here you select the values you want to export",
"Status":{
"Idle":"Idle",
"Status":"Status: ",
"Processing-Chunk":"Processing chunk {current} of {total}",
"Processing-Chunk-Detailed":"Processing chunk {current} of {total}.\nItems to export: {urlStr}",
"StartExport":"Starting to Export",
"GetSectionItems":"Initial fetching items of {idx} in chuncks of {chunck}"
} }
}, },
"About":{ "About":{

View file

@ -61,6 +61,8 @@
>{{ $t("Modules.ET.HExportMedia") }}</b-button> >{{ $t("Modules.ET.HExportMedia") }}</b-button>
</div> </div>
<div name="status"> <div name="status">
<b-form-input readonly
id="outDirbox" name="outDirbox" v-model="count" :disabled=true v-bind:placeholder="$t('Modules.ET.Status.Status')" />
{{ count }} {{ count }}
</div> </div>

View file

@ -36,7 +36,8 @@
import i18n from '../../../../i18n' import i18n from '../../../../i18n'
export default { export default {
created() { created() {
this.getcbDefaults() this.getcbDefaults(),
console.log('Ged strOrgTitleNull: ' + + i18n.t('Modules.ET.Settings.OrgTitleNull'))
}, },
data() { data() {
return { return {

View file

@ -16,7 +16,8 @@ function loadLocaleMessages () {
var langFile = wtutils.Home + '/locales/' + langCode + '.json' var langFile = wtutils.Home + '/locales/' + langCode + '.json'
log.debug(`Loading language: ${langCode}`) log.debug(`Loading language: ${langCode}`)
messages[langCode] = JSON.parse(fs.readFileSync(langFile, 'utf8')); messages[langCode] = JSON.parse(fs.readFileSync(langFile, 'utf8'));
if (wtconfig.get('General.language') != 'en'){ log.debug(`Defined language: ${wtconfig.get('General.language')}`)
if (wtconfig.get('General.language', 'en') != 'en'){
// We need to preload an additional language // We need to preload an additional language
const langCode = wtconfig.get('General.language') const langCode = wtconfig.get('General.language')
langFile = wtutils.Home + '/locales/' + langCode + '.json' langFile = wtutils.Home + '/locales/' + langCode + '.json'

View file

@ -22,9 +22,6 @@ Vue.use(Buefy);
Vue.use(BootstrapVue); Vue.use(BootstrapVue);
// Logging start // Logging start
// Remember to define log in all components where its used, as in below // Remember to define log in all components where its used, as in below
const log = require('electron-log'); const log = require('electron-log');
@ -39,7 +36,6 @@ log.transports.file.fileName = wtutils.AppName;
log.transports.file.maxSize = wtconfig.get('Log.maxSize', 1048576); log.transports.file.maxSize = wtconfig.get('Log.maxSize', 1048576);
console.log = log.log; console.log = log.log;
log.info('*********************************') log.info('*********************************')
log.info('Starting ' + wtutils.AppName + ' Version:' + wtutils.AppVersion); log.info('Starting ' + wtutils.AppName + ' Version:' + wtutils.AppVersion);