What is it dot-separated string resource name for?

懵懂的女人 提交于 2019-12-10 17:36:33

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!