本地化错误“已在此处翻译,但未在默认语言环境中翻译" [英] Localisation error 'is translated here but not in default locale'

查看:187
本文介绍了本地化错误“已在此处翻译,但未在默认语言环境中翻译"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了values-frvalues-esvalues.

values的内容为英语,但是对于每个字符串,我都会收到此错误:

The contents of values is english, but for each string I am getting this error:

<string name="cancel">Cancel</string>

它说:"cancel" is translated here but is not found in default locale,我不确定这是什么意思.

it says: "cancel" is translated here but is not found in default locale and im not sure what this means.

values/strings.xml

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation" tools:locale="en">

    <string translatable="false" name="app_name">Kendal Mintfest</string>
    <string name="action_settings">Settings</string>
    <string name="itin_string">Itinerary</string>
    <string name="event_string">Events</string>
    <string name="info_string">Info!</string>
    <string name="filerText">Note: Turning this option on will show only results on the selected day on the hour you select.</string>
    <string-array name="time_filter_array">
        <item>Friday 30th August</item>
        <item>Saturday 31st August</item>
        <item>Sunday 1st September</item>
    </string-array>
    <color name="Pink">#EC008B</color>
    <string name="okay">Okay</string>
    <string name="cancel">Cancel</string>
</resources>

values-fr/strings.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="action_settings">Paramètres</string>
    <string name="itin_string">itinéraire</string>
    <string name="event_string">Events</string>
    <string name="info_string">Info!</string>
    <string name="filerText">Remarque: Activer cette option affichera uniquement les r\ésultats le jour sélectionné à l\'heure que vous sélectionnez.</string>
    <string-array name="time_filter_array">
         <item>Vendredi 30 Août</item>
         <item>Samedi 31 Août</item>
         <item>dimanche 1er Septembre</item>
    </string-array>
    <color name="Pink">#EC008B</color>
    <string name="okay">OK</string>
    <string name="cancel">Annuler</string>
</resources>

values-es/strings.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="action_settings">Configuración</string>
    <string name="itin_string">Itinerario</string>
    <string name="event_string">Events</string>
    <string name="info_string">Info!</string>
    <string name="filerText">Nota: Al activar esta opción sólo mostrará los resultados en el día seleccionado en la hora de seleccionar.</string>
    <string-array name="time_filter_array">
         <item>Viernes 30 de agosto</item>
         <item>Sábado 31 de agosto</item>
         <item>Domingo 01 de septiembre</item>
    </string-array>
    <color name="Pink">#EC008B</color>
    <string name="okay">Okay</string>
    <string name="cancel">Cancelar</string>
</resources>

注意:我上面提到的错误发生在所有values/strings.xml

Note: the error I stated above happens on ALL of the values/strings.xml lines

推荐答案

对我来说,当我在翻译文件中添加<resources xmlns:tools="http://schemas.android.com/tools" tools:locale="en">而不是<resources>时,这开始出现.如果添加tools:ignore="ExtraTranslation",则它应该消失,恕我直言

To me this started to appear when I added <resources xmlns:tools="http://schemas.android.com/tools" tools:locale="en"> instead of just <resources> in the translation files. If you add tools:ignore="ExtraTranslation" then it should disappear IMHO

这篇关于本地化错误“已在此处翻译,但未在默认语言环境中翻译"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆