plugins
plugins copied to clipboard
[android][Localize] Values-(default language) not generated
Hi @NathanWalker,
There is little issue with the localize plugin, the default language not generated in his own folder because of this rule since it is the default language the hook generate the strings for res/values/strings.xml only, I think it should generate also res/values-en/strings.xml.
I suggest this :
run() {
this.dataProvider.getLanguages().forEach((languageI18nEntries, language) => {
// ADD THIS
if(language === this.dataProvider.getDefaultLanguage()) {
this.createLanguageResourcesFiles(language, false, languageI18nEntries);
}
this.createLanguageResourcesFiles(language, language === this.dataProvider.getDefaultLanguage(), languageI18nEntries);
});
if (fs.existsSync(this.appResourcesDirectoryPath) && fs.statSync(this.appResourcesDirectoryPath).isDirectory()) {
this.cleanObsoleteResourcesFiles(this.appResourcesDirectoryPath, this.dataProvider.getLanguages());
}
return this;
}
@farfromrefug what do you think ?
Is ashame as it replaces the default strings.xml file I have.
Seems to have a been a thing in another localize package before this.
https://github.com/EddyVerbruggen/nativescript-localize/pull/88