kelvinhokk / cordova-plugin-localization-strings

Cordova Plugin for Localization of Strings on the App
MIT License
119 stars 106 forks source link

Changes for platform specific app-keys (Issue 37) #46

Closed pklaes closed 5 years ago

pklaes commented 5 years ago

This should solve #37 .

The .json files can now contain three .app keys:

A platform specific translation should overwrite a general translation, if it exists.

Example:

{
    "app": {
        "HAVE_MAIL_TITLE": "Sie haben Post. This should be overwritten by platform-specific string.",
        "HAVE_MAIL_MSG": "%1$@ has you a message titled \\\"%2$@\\\""
    },
    "app_ios": {
        "HAVE_MAIL_TITLE": "Sie haben Post in iOS.",
        "Key with Spaces": "Schlüssel mit Leerzeichen"
    },
    "app_android": {
        "HAVE_MAIL_TITLE": "Sie haben Post in Android.",
        "ONLY_ON_ANDROID": "Testmeldung nur unter Android."
    }
}
rodrigograca31 commented 5 years ago

Everything seems ok. Just a question: did you test it with a project and works?

rodrigograca31 commented 5 years ago

P.S. Also feel free to contribute to the README.md otherwise I will do it when I accept the PR

pklaes commented 5 years ago

I just checked the resulting ressource files under platforms/* as i don't need this feature right now.