2016-06-13 13 views
0

私はudacityクラスのためにアプリケーションを翻訳しようとしていますので、アプリケーションにコードスニペットをコピーしましたが、アプリを実行するとオーダーサマリに%記号が表示されます。私はgetString()を呼び出すときは、フォーマット引数を省略すると思います xliffを使用するとパーセンテージのシンボルが表示されます

Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the 
    user's name. [CHAR LIMIT=NONE] 
--> 
<string name="order_summary_name">Name: <xliff:g id="name" example="Amy">%s</xliff:g></string> 

<!-- 
    Whipped cream topping for the order summary. It will be shown in the format of 
    "Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE] 
--> 
<string name="order_summary_whipped_cream">Add whipped cream? <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string> 

<!-- 
    Chocolate topping for the order summary. It will be shown in the format of 
    "Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE] 
--> 
<string name="order_summary_chocolate">Add chocolate? <xliff:g id="addChocolate" example="true">%b</xliff:g></string> 

<!-- 
    Quantity of coffee cups for the order summary. It will be shown in the format of 
    "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE] 
--> 
<string name="order_summary_quantity">Quantity: <xliff:g id="quantity" example="2">%d</xliff:g></string> 

<!-- 
    Total price for the order summary. It will be shown in the format of 
    "Total: $10" where $10 is the price. [CHAR LIMIT=NONE] 
--> 
<string name="order_summary_price">Total: <xliff:g id="price" example="$10">%s</xliff:g></string> 

<!-- Thank you message for the order summary. [CHAR LIMIT=NONE] --> 
<string name="thank_you">Thank you!</string> 

<!-- 
    Subject line for the order summary email. It will be in the format of 
    "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE] 
--> 
<string name="order_summary_email_subject">Just java for: <xliff:g id="name" example="Amy">%s</xliff:g></string> 

`

答えて

0

をme.`助けてください。あなたがgetString(R.string.order_summary_name)のようなものを持っているかどうかを確認し、それを修正する引数リストの最後にname文字列を追加してください。

+0

ありがとうございました。 –

関連する問題