问题
I'am using a snake_style for the naming of string resources. In someones code i found another notation, with dots. I couldn't be able to found single word about this topic.
<resources>
<string name="title.activity.first">Activity 1</string>
<string name="title_activity_second">Activity 2</string>
</resources>
Is there any practical advantage/disadvantage of theese styles? Or it is just a cosmetic thing?
回答1:
It seems to be just a cosmetic thing, but it has downside of breaking translation check in android studio, so it shows a warning of no translations. In my case renaming dots to underscores didn't break anything, updated project without any issue.
回答2:
In my case, it's braking almost "everything"! It compiles, but I cannot use the autocomplete with any resource (strings, drawables, etc). I'll need to refactor every string resources in that file.
来源:https://stackoverflow.com/questions/32971563/what-is-it-dot-separated-string-resource-name-for