plugins icon indicating copy to clipboard operation
plugins copied to clipboard

[android][Localize] Values-(default language) not generated

Open kefahB opened this issue 3 years ago • 2 comments

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;
}

kefahB avatar Nov 28 '22 11:11 kefahB

@farfromrefug what do you think ?

kefahB avatar Dec 01 '22 19:12 kefahB

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

liamcharmer avatar Aug 09 '23 17:08 liamcharmer