Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio: Translation Editor not showing Default Value and translation

The Translation Editor of my Android Studio does not work properly. If I open the translation editor does list the correct keys of the strings, however the default values and the translations can not be found. All keys have a default value and most of them have a translation, too.

enter image description here

I restarted Android Studio, performed a clean and rebuild, however the translation editor does not work. Any ideas or suggestions how to fix this?

like image 750
Petterson Avatar asked Apr 23 '18 11:04

Petterson


People also ask

How do I open the translation editor in Android Studio?

Open from the Android viewIn the Project > Android panel on the left, select ModuleName > res > values. Right-click the strings. xml file, and select Open Translations Editor. The Translations Editor displays the key and value pairs from the strings.

Can Android Studio automatically translate your app into other languages?

In the Translation Editor, click the globe-icon to add a new language file, in our example we will add 'de' (German) and 'es"(Spanish). You may need to close and re-open the Translation Editor tab after adding a new language if it does not show up immediately.

What is Android TranslationZ?

TranslationZ is a dynamic property used for animation. Basically it's needed to nicely handle elevation changes.


2 Answers

Try File --> Invalidate Caches / Restart .. It solved the same issue with me ..

like image 167
Ahmed Awadallah Avatar answered Sep 23 '22 16:09

Ahmed Awadallah


In my case, Translations Editor didn't show my other languages too. But my problem was I had empty strings.xml files for those languages. I mean, like following:

<resources>
</resources>

Once I added some string in those files, even if they were empty, it began appearing in Translations Editor, such as following:

<resources>
    <string name="any_string" />
</resources>

Although you might need to click on refresh button at Translations Editor to update the view.

like image 20
Rubén Viguera Avatar answered Sep 21 '22 16:09

Rubén Viguera