久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <tfoot id='IIpTl'></tfoot>
      <legend id='IIpTl'><style id='IIpTl'><dir id='IIpTl'><q id='IIpTl'></q></dir></style></legend>
      • <bdo id='IIpTl'></bdo><ul id='IIpTl'></ul>
        <i id='IIpTl'><tr id='IIpTl'><dt id='IIpTl'><q id='IIpTl'><span id='IIpTl'><b id='IIpTl'><form id='IIpTl'><ins id='IIpTl'></ins><ul id='IIpTl'></ul><sub id='IIpTl'></sub></form><legend id='IIpTl'></legend><bdo id='IIpTl'><pre id='IIpTl'><center id='IIpTl'></center></pre></bdo></b><th id='IIpTl'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='IIpTl'><tfoot id='IIpTl'></tfoot><dl id='IIpTl'><fieldset id='IIpTl'></fieldset></dl></div>

        <small id='IIpTl'></small><noframes id='IIpTl'>

      1. 用戶消息中的多個

        Plurality in user messages(用戶消息中的多個)
        <legend id='xp7oi'><style id='xp7oi'><dir id='xp7oi'><q id='xp7oi'></q></dir></style></legend>
          <tfoot id='xp7oi'></tfoot>
              <i id='xp7oi'><tr id='xp7oi'><dt id='xp7oi'><q id='xp7oi'><span id='xp7oi'><b id='xp7oi'><form id='xp7oi'><ins id='xp7oi'></ins><ul id='xp7oi'></ul><sub id='xp7oi'></sub></form><legend id='xp7oi'></legend><bdo id='xp7oi'><pre id='xp7oi'><center id='xp7oi'></center></pre></bdo></b><th id='xp7oi'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='xp7oi'><tfoot id='xp7oi'></tfoot><dl id='xp7oi'><fieldset id='xp7oi'></fieldset></dl></div>

                  <tbody id='xp7oi'></tbody>

                  <bdo id='xp7oi'></bdo><ul id='xp7oi'></ul>
                • <small id='xp7oi'></small><noframes id='xp7oi'>

                • 本文介紹了用戶消息中的多個的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  很多時候,當生成要顯示給用戶的消息時,該消息將包含一些我想告知客戶的東西.

                  Many times, when generating messages to show to the user, the message will contain a number of something that I want to inform the customer about.

                  我舉個例子:客戶從 1 起選擇了多個項目,并單擊了刪除.現在我想給客戶一個確認信息,我想提一下他選擇的項目數量,以通過選擇一堆項目并在他只想刪除其中一個時單擊刪除來最大程度地減少他出錯的機會他們.

                  I'll give an example: The customer has selected a number of items from 1 and up, and has clicked delete. Now I want to give a confirmation message to the customer, and I want to mention the number of items he has selected to minimize the chance of him making a mistake by selecting a bunch of items and clicking delete when he only wants to delete one of them.

                  一種方法是制作這樣的通用消息:

                  One way is to make the generic message like this:

                  int noofitemsselected = SomeFunction();
                  string message = "You have selected " + noofitemsselected + " item(s). Are you sure you want to delete it/them?";
                  

                  這里的問題"是 noofitemselected 為 1 的情況,我們必須寫 itemit 而不是 項目他們.

                  The "problem" here is the case where noofitemselected is 1, and we have to write item and it instead of items and them.

                  我的正常解決方案是這樣的

                  My normal solution will be something like this

                  int noofitemsselected = SomeFunction();
                  string message = "You have selected " + noofitemsselected + " " + (noofitemsselected==1?"item" : "items") + ". Are you sure you want to delete " + (noofitemsselected==1?"it" : "them") + "?";
                  

                  如果代碼中有很多對數字復數的引用,那么這會變得很長而且非常快,而且實際的消息很難閱讀.

                  This gets quite long and quite nasty really fast if there are many references to the numbers plurality inside the code, and the actual message gets hard to read.

                  所以我的問題很簡單.有沒有更好的方法來生成這樣的消息?

                  So my questions is simply. Are there any better ways of generating messages like this?

                  編輯

                  我看到很多人對我提到消息應該顯示在消息框內的情況非常感興趣,并且只是簡單地給出了如何完全避免使用消息框的答案,并且都很好.

                  I see a lot of persons has got very hung up in the case that I mentioned that the message should be displayed inside a message box, and has simply given an answer of how to avoid using the message box at all, and that is all good.

                  但請記住,除消息框外,復數化問題也適用于程序中其他地方的文本.例如,顯示在網格中選擇的行數的網格旁邊的標簽將在復數方面存在相同的問題.

                  But remember that the problem of pluralization also apply to texts other places in the program in addition to message boxes. For example, a label alongside a grid displaying the number of lines selected in the grid will have the same problem regarding pluralization.

                  所以這基本上適用于大多數從程序以某種方式輸出的文本,然后解決方案并不像僅僅將程序更改為不再輸出文本那么簡單:)

                  So this basically apply to most text that is outputted in some way from programs, and then the solution is not as simple as to just change the program to not output text anymore :)

                  推薦答案

                  如果有任何機會,無論多么小,這個應用程序都需要翻譯成其他語言,那么兩者都是錯誤的.正確的做法是:

                  If there is ever any chance, no matter how small, that this app will need to be translated to other languages then both are wrong. The correct way of doing this is:

                  string message = ( noofitemsselected==1 ?
                    "You have selected " + noofitemsselected + " item. Are you sure you want to delete it?":
                    "You have selected " + noofitemsselected + " items. Are you sure you want to delete them?"
                  );
                  

                  這是因為不同的語言處理復數的方式不同.有些像馬來語甚至沒有語法復數,所以字符串通常是相同的.將這兩個字符串分開可以更容易地在以后支持其他語言.

                  This is because different languages handle plurality differently. Some like Malay don't even have syntactic plurals so the strings would generally be identical. Separating the two strings makes it easier to support other languages later on.

                  否則,如果此應用程序旨在供公眾使用并且應該對用戶友好,那么第二種方法更可取.抱歉,我真的不知道更短的方法.

                  Otherwise if this app is meant to be consumed by the general public and is supposed to be user friendly then the second method is preferable. Sorry but I don't really know a shorter way of doing this.

                  如果此應用僅供貴公司內部使用,請執行快捷方式 "item(s)" 操作.在編寫企業代碼時,您實際上不必給任何人留下深刻印象.但我建議不要對公開消費的應用程序這樣做,因為這給人的印象是程序員很懶惰,從而降低了他們對應用程序質量的看法.相信我,像這樣的小事.

                  If this app is meant to be consumed only internally by your company then do the shortcut "item(s)" thing. You don't really have to impress anybody when writing enterprisy code. But I'd advise against doing this for publicly consumed app because this gives the impression that the programmer is lazy and thus lower their opinion of the quality of the app. Trust me, small things like this matter.

                  這篇關于用戶消息中的多個的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Ignore whitespace while reading XML(讀取 XML 時忽略空格)
                  XML to LINQ with Checking Null Elements(帶有檢查空元素的 XML 到 LINQ)
                  Reading XML with unclosed tags in C#(在 C# 中讀取帶有未閉合標簽的 XML)
                  Parsing tables, cells with Html agility in C#(在 C# 中使用 Html 敏捷性解析表格、單元格)
                  delete element from xml using LINQ(使用 LINQ 從 xml 中刪除元素)
                  Parse malformed XML(解析格式錯誤的 XML)
                      <bdo id='WeRaj'></bdo><ul id='WeRaj'></ul>
                          <i id='WeRaj'><tr id='WeRaj'><dt id='WeRaj'><q id='WeRaj'><span id='WeRaj'><b id='WeRaj'><form id='WeRaj'><ins id='WeRaj'></ins><ul id='WeRaj'></ul><sub id='WeRaj'></sub></form><legend id='WeRaj'></legend><bdo id='WeRaj'><pre id='WeRaj'><center id='WeRaj'></center></pre></bdo></b><th id='WeRaj'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='WeRaj'><tfoot id='WeRaj'></tfoot><dl id='WeRaj'><fieldset id='WeRaj'></fieldset></dl></div>

                            <tbody id='WeRaj'></tbody>
                            <tfoot id='WeRaj'></tfoot>
                          • <small id='WeRaj'></small><noframes id='WeRaj'>

                          • <legend id='WeRaj'><style id='WeRaj'><dir id='WeRaj'><q id='WeRaj'></q></dir></style></legend>
                          • 主站蜘蛛池模板: 亚洲精品一区二区三区在线 | 日韩精品免费视频 | www.亚洲视频.com | 欧美性网站 | 欧美精品在线播放 | 91av视频在线播放 | 国产九九九 | 一区二区三区欧美在线观看 | 欧美一级免费看 | www.成人久久| 美女爽到呻吟久久久久 | 久久精品免费 | 亚洲女人天堂网 | 国产成人精品免费视频大全最热 | 国产色片在线 | 亚洲www| 国产成人免费视频 | 99视频在线播放 | 国产欧美精品一区二区三区 | 国产免费一级一级 | 国产综合视频 | 日韩精品久久 | 日韩精品免费 | 在线播放国产视频 | 好好的日在线视频 | 日本久久一区二区三区 | 中文字幕乱码一区二区三区 | 久久久久久久一区二区三区 | 欧美美女爱爱 | 在线黄av | 自拍偷拍中文字幕 | 中文字幕 国产 | 中文字幕在线观看成人 | 免费看av大片 | 欧美 日韩 国产 在线 | 日日天天 | 天堂成人国产精品一区 | 精品自拍视频在线观看 | 三级欧美| 天天干夜夜操 | a级大毛片 |