When I'm working on Android project I would like to use some magic shortcut that would extract my string to strings.xml and also allow me to change the key. Is there any?
If there isn't, is there a way to develop new refactorization methods and extend IntelliJ possibilities?
IntelliJ IDEA provides a special intention action i18nize hard coded string literal to extract string literals into your properties files. You can access the resource bundle using either the java.
So, you can combine string resources with other simple resources in the one XML file, under one <resources> element. The filename is arbitrary. The <string> element's name is used as the resource ID.
It allows you to easily locate text in your app and later have it translated. Strings can be internationalized easily, allowing your application to support multiple languages with a single application package file (APK).
Alt+Enter (to invoke intention action menu) on a string, then use Add a string resource action from the menu.
To rename resource use Refactor
| Rename
while standing on a resource name in Java code, it will rename all the references and the resource itself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With