简体   繁体   中英

Translations editor not enabled in Android Studio

I'm trying to translate a strings.xml file on Android Studio but it seems like the Translations Editor is not enabled (it does not appear as an option when I right click on the strings.xml file). I've tried deleting and installing back Android Studio but it's still the same; any ideas on how to solve?

Thank you in advance! this is the "no enabled action found message I get

you have to open the string.xml file, then you will see the open editor option on the upper right side

Reopen the Android Studio IDE, it'll solve the problem. Also it will update the strings and refresh the layout of any layout xml.

Translations Editor shows up when you right-click on string resource files whose names end with strings.xml . On others it does not. The same goes for editor option that is supposed to show up in upper right side when string resource file is opened.

So, filenames like strings.xml , preferences_strings.xml , etc. are fine, while strings_intro.xml , etc. are not.

In case you don't have any string resource files named in that way, you can create an empty one named strings.xml and use it to open Translations Editor.

Or, you can open the it in the following way:

  1. Open any xml layout file
  2. Switch to 'Design' view in upper right corner
  3. Design toolbar will look something like the following: 在此处输入图像描述
  4. Click on the localizations option (globe icon)
  5. At the bottom of the drop-down menu you will see 'Edit Translations...' option
  6. Click on it - and there you are!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM