WEB頁面多語言功能

2021-10-04 04:16:19 字數 856 閱讀 4125

之前做的多語言功能是在資料庫中,目前想做個json檔案格式的多語言功能

1.編輯en-us.json檔案

頁面中呼叫的方法

[email protected]("page.label.username")

下面是c#讀取json檔案的方法,但是jobject是否有更簡潔的用法,目前我還沒有找到

using com.aaa.dbutility;

using mysql.data.mysqlclient;

using newtonsoft.json;

using newtonsoft.json.linq;

using system.data;

using system.globalization;

using system.io;

namespace com.aaa.translation

public static string getjsonfile()

string result = "";

using (streamreader r = new streamreader(jsonfile))

return result;

}public static string gettext(string node)

jobj = (jobject)jobj[arr[x]]; }}

return result;} }

}

軟體多語言

locale是指特定於某個國家或地區的一組設定,包括字符集,數字 貨幣 時間和日期的格式等。在windows中,每個locale可以用乙個32位數字表示,記作lcid。在winnt.h中可以看到lcid的組成。它的高16位表示字元的排序方法,一般為0。在它的低16位中,低10位是primary la...

多語言切換

專案中應用到了多語言切換,鞏固一下。貼上 大家一起學習。廢話不多說直接上 1 新增多語言 在res values 下預設有個strings,需要多種語言就來建立幾個strings,values右鍵 new 乙個 values res file file name 就是strings director...

在程式增加多語言功能

先做個廣告 e label是乙個專業條碼標籤列印軟體.它會讓條碼標籤列印變得更簡單.更方便二次開發 net 目前此軟體在beta階段.如果你對些軟體有興趣可以到 http www.ync tech.com下截beta版本 最近一直在開發e label,客戶提出來了新需求,要支援簡體中文,正體中文,e...