1

In an Android project, the strings.xml file currently contains localized strings that are displayed to the user and system strings like Facebook App ID which are not displayed to the user.

The localized strings are regularly updated and exported from a translation platform.

The issue is that every time the localized strings are exported, the strings.xml file has to be manually updated by adding the system strings to the new strings file. In iOS the localized string resources files can just be replaced without manual editing because the Localizable.strings files are distinct files.

Is it possible to keep localized strings in a separate file, so they can be easily updated by just replacing the whole file?

1 Answer 1

2

Sure. In the res/values/ and res/values-.../ directories, the filenames do not matter. By convention, we put strings in strings.xml, but you are welcome to have more than one resource file containing string resources, where you decide which string resources go in which file.

Personally I would avoid putting API keys in string resources in the first place. They are often only used in one place and, as you point out, they do not need translating, so using string resources for them adds little to no value.

But, if you want two files with string resources, one for user-facing translated strings and one for miscellaneous non-translated strings, you are welcome to do so.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.