gpt4 book ai didi

java - 本地化 xliff 错误消息

转载 作者:行者123 更新时间:2023-12-02 03:21:40 35 4
gpt4 key购买 nike

我已经使用 xliff 创建了一个资源字符串,但在运行应用程序时出现错误:

Error:(17, 52) Error: The prefix "id" for attribute "id:" associated with an element type "xliff:g" is not bound.

Error:Execution failed for task ':app:mergeDebugResources'.
> C:\Users\msanli\AndroidStudioProjects\JustJava\app\src\main\res\values\strings.xml:17:52: Error: The prefix "id" for attribute "id:" associated with an element type "xliff:g" is not bound.

我已经将其添加到我的资源附近,所以我不确定发生了什么

(xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2")。

感谢任何帮助!

资源:

<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_name">Just Java</string>
<string name="hint_name">Name</string>
<string name="toppings_header">Toppings</string>
<string name="whipped_cream">Whipped Cream</string>
<string name="chocolate">Chocolate</string>
<string name="quantity_header">Quantity</string>
<string name="decrement_minus">-</string>
<string name="quantity_text">1</string>
<string name="increment_plus">+</string>
<string name="order_text">Order</string>
<string name="max_coffee_toast">You cannot have more than 100 cups of coffee</string>
<string name="min_coffee_toast">You cannot have less than 1 cup of coffee</string>
<string name="admin_email"></string>
<string name="email_order_subject">Just Java Order Summary For </string>
<string name="name_order_summary">
Name: <xliff:g id:="name" example="Samuel">%s</xliff:g>
</string>
<string name="whipped_cream_ordered">Add Whipped Cream? </string>
<string name="chocolate_ordered">Add Chocolate? </string>
<string name="quantity">Quantity: </string>
<string name="total_price">Total Price: $</string>
<string name="thank_you">Thank You!</string>



</resources>

最佳答案

您的资源不是有效的 XML:尝试删除 id:="name" 中的冒号,看看是否有任何区别。

关于java - 本地化 xliff 错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39519888/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com