【发布时间】:2016-09-15 20:32:44
【问题描述】:
我使用 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>
【问题讨论】:
标签: java android xml string xliff