Issue
So I have string.xml files for two languages, english and swahili. I let my users choose their default languages. And everything goes well until when I save the string resource ID for later use when they decide to change the language from the application's settings,but whenever I edit or add another string resource,and update my application, the original string ID's change and the string resource ID's that I saved in the database end up fetching values from different string resource from what my users had selected earlier. How do I overcome this? or stop my string resource ID's from changing every time I add new strings.
Solution
And everything goes well until when I save the string resource ID for later use
That is not a good plan.
but whenever I edit or add another string resource,and update my application, the original string ID's change and the string resource ID's that I saved in the database end up fetching values from different string resource from what my users had selected earlier
That is why this is not a good plan. Resource IDs are not designed to be constant from build to build.
How do I overcome this?
Do not store string resource IDs in a file, database, Web service, or similar container. Instead, store some identifier that you control that allows you to determine what string resource ID(s) that you should use.
Answered By - CommonsWare
Answer Checked By - Robin (JavaFixing Admin)