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

  • <tfoot id='m5DDD'></tfoot>
    <legend id='m5DDD'><style id='m5DDD'><dir id='m5DDD'><q id='m5DDD'></q></dir></style></legend>

  • <small id='m5DDD'></small><noframes id='m5DDD'>

    • <bdo id='m5DDD'></bdo><ul id='m5DDD'></ul>

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

      1. C# 類庫本地化

        C# Class Library Localization(C# 類庫本地化)

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

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

            <legend id='LRqWE'><style id='LRqWE'><dir id='LRqWE'><q id='LRqWE'></q></dir></style></legend>

              <bdo id='LRqWE'></bdo><ul id='LRqWE'></ul>
                • 本文介紹了C# 類庫本地化的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我需要快速了解類庫中的本地化

                  I need a very quick introduction to localization in a class library

                  我對從用戶上下文中提取語言環境不感興趣,而是我將用戶存儲在數據庫中,并且他們的語言環境也在數據庫中設置....

                  I am not interested in pulling the locale from the user context, rather I have users stored in the db, and their locale is also setup in the db....

                  我在類庫中的函數已經可以從數據庫中的用戶配置文件中提取語言環境代碼...現在我想根據語言環境包含使用 resx...

                  my functions in the class library can already pull the locale code from the user profile in the db... now I want to include use resx depending on locale...

                  我需要幾個步驟才能正確執行此操作...

                  I need a few steps to do this correctly...

                  是的 - 我已經用谷歌搜索了這個,并進行了一些研究,但我能找到的所有教程都太復雜了,無法滿足我的需求.

                  And yeah - I have already googled this, and some research, but all the tutorials I can find are way too complex for my needs.

                  推薦答案

                  不幸的是,這個主題太復雜了.;) 我知道,我也做過研究.

                  Unfortunately, this subject is way too complicated. ;) I know, I've done the research as well.

                  為了讓你開始,

                  1. 在您的程序集中創建一個 Resources 目錄.

                  1. create a Resources directory in your assembly.

                  從英語開始,然后將資源文件"(.resx) 添加到該目錄.將其命名為text.resx".如果找不到本地化資源,應用程序將默認拉出該文件.

                  Start with English and add a "Resources File" (.resx) to that directory. Name it something like "text.resx". In the event that the localized resource can't be found, the app will default to pulling out of this file.

                  添加您的文本資源.

                  添加另一個資源文件.將其命名為text.es.resx".注意文件名的es"部分.在這種情況下,這定義了西班牙語.請注意,每種語言都有自己的字符代碼定義.查一下.

                  Add another resources file. Name this one something like "text.es.resx" Note the "es" part of the file name. In this case, that defines spanish. Note that each language has it's own character code definition. Look that up.

                  將您的西班牙語資源添加到其中.

                  Add your spanish resources to it.

                  現在我們有了可以使用的資源文件,讓我們嘗試實現.

                  Now that we have resource files to work from, let's try to implement.

                  為了設置文化,從您的數據庫記錄中提取它.然后執行以下操作:

                  In order to set the culture, pull that from your database record. Then do the following:

                  String culture = "es-MX"; // defines spanish culture
                  Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(culture);
                  Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture);
                  

                  這可能發生在已加載程序集的應用程序或程序集初始化本身中.你選.

                  This could happen in the app that has loaded your assembly OR in the assembly initialization itself. You pick.

                  要利用資源,您只需在程序集中執行以下操作:

                  To utlize the resource, all you have to do is something like the following within your assembly:

                  public string TestMessage() {
                    return Resources.Text.SomeTextValue;
                  }
                  

                  達達.資源變得容易.如果您需要更改用戶控件或直接在 aspx 頁面中執行某些操作,事情可能會變得更復雜一些.如果您需要更多信息,請更新您的問題.

                  Ta Da. Resources made easy. Things can get a little more complicated if you need to change usercontrols or do something directly in an aspx page. Update your question if you need more info.

                  請注意,您可以擁有名為text.es-mx.resx"的資源文件,這將是特定于墨西哥西班牙語的.但是,這并不總是必要的,因為es-mx"會在回退到默認值之前回退到es".只有您自己知道您的資源需要有多具體.

                  Note that you could have resource files named like "text.es-mx.resx" That would be specific to mexican spanish. However, that's not always necessary because "es-mx" will fall back to "es" before it falls back to the default. Only you will know how specific your resources need to be.

                  這篇關于C# 類庫本地化的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)
                      <tbody id='emwM5'></tbody>
                    <i id='emwM5'><tr id='emwM5'><dt id='emwM5'><q id='emwM5'><span id='emwM5'><b id='emwM5'><form id='emwM5'><ins id='emwM5'></ins><ul id='emwM5'></ul><sub id='emwM5'></sub></form><legend id='emwM5'></legend><bdo id='emwM5'><pre id='emwM5'><center id='emwM5'></center></pre></bdo></b><th id='emwM5'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='emwM5'><tfoot id='emwM5'></tfoot><dl id='emwM5'><fieldset id='emwM5'></fieldset></dl></div>
                    • <tfoot id='emwM5'></tfoot>
                        <bdo id='emwM5'></bdo><ul id='emwM5'></ul>

                      • <small id='emwM5'></small><noframes id='emwM5'>

                          <legend id='emwM5'><style id='emwM5'><dir id='emwM5'><q id='emwM5'></q></dir></style></legend>

                            主站蜘蛛池模板: 日本成人中文字幕在线观看 | 欧美韩一区二区三区 | 91久久国产精品 | 亚洲热在线视频 | 精品国产乱码久久久久久果冻传媒 | 久久久久久亚洲精品 | 国产毛片久久久久久久久春天 | 日本三级网址 | 日韩免费网站 | 亚洲国产成人av好男人在线观看 | 欧美日韩国产一区二区三区 | 亚洲网站在线播放 | 欧美一级片在线看 | 国产激情福利 | 日本高清视频在线播放 | 一区二区三区中文字幕 | av男人的天堂av | 久久99精品久久久久久国产越南 | 成人亚洲片 | 精品欧美视频 | 二区成人| 九九激情视频 | av网址在线播放 | 久久久久久久久久久久久久国产 | a级性视频| 欧美一级黄色片在线观看 | 狼人伊人影院 | 毛片网站在线观看视频 | 在线免费观看成年人视频 | 酒色成人网 | 激情av免费看 | 亚洲在线成人 | 久久久123 | 久久国产欧美一区二区三区精品 | 国产精品久久久久久久粉嫩 | 午夜精品久久久久久久星辰影院 | 91久久精品国产91久久性色tv | 成人福利在线观看 | 亚洲精品91 | 欧美日韩三级 | 亚洲综合无码一区二区 |