Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use gettext technology to realize internationalization support for ASP.NET website

Shulou Source: shulou.com Published: 2022-06-02 11:29:12 10月07日 Update

This article will explain in detail how to use gettext technology to achieve international support for ASP.NET websites. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

I don't know how many people are interested in this topic, because I have been playing with a website recently, and I have some leisure to add international support to the website. Although ASP.NET already has the ResourceManager class and supports the internationalization of tags, its problem is that ResourceManager requires a Key for every sentence that needs to be translated:

1. First create a .resx file, and in Visual Studio, there is a tool to edit the .resx file.

two。 Add a key-value pair to each sentence that needs to be translated.

3. Then in the code, use ResourceManager or > source.lst dir / s / b src\ *. Cshtml > > source.lst tools\ zgettext\ zgettext\ bin\ Debug\ zgettext.exe-k T-f source.lst-o glob\ website.po tools\ zgettext\ msgfmt\ bin\ msgfmt.exe-o src\ App_GlobalResources\ website.resources-I glob\ website.po popd on how to use gettext technology to implement internationalization support for ASP.NET websites. I hope the above content can be of some help to you and learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: File program support sentence text function format international website key keyword namely time source code idea path output code file name method Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Redmi Xiaomi Shulou Technology MySQL