Efficient and reliable multi-language development

Source: Internet
Author: User

:Http://sailingease.com/ssr

 

Se string resource is a utility used to assist software development in multiple languages. It aims to constrain the implementation of resources in different languages by generating interfaces, so that developers can call resources based on interfaces.

In addition, it provides various practical functions that are convenient for developers, such as multi-project parallel editing, resource import, Excel import, and export.

GeneratedCodeIs based on the resx resource file, so it is fully compatible with. Net's own resource access method and retains all the advantages of. net resource files.

 

This tool is completely developed by myself in my daily work. I checked it when developing a multi-language project. net resource access mechanism, when processing resources in multiple regions (multi-language), one is relatively troublesome, the other is not controllable, and it is very eager to generate resource files and corresponding code, you can use one interface to constrain all of them, so that I can use ilanguage when using it. the string method is used. In addition, because of the large project scale and a large amount of resources (my personal situation, there are thousands of resources), I hope to control these resources in a unified manner, using the native method in Visual Studio to develop large projects doesn't feel too difficult.

In addition, my situation is quite special. The entire project is divided into many modules for separate development. I want to put resources in a separate class library and correspond to modules, A module is a resource class library (and can also be used in the module). This also involves switching between different modules and editing resources. At first, I still can endure it, later, I didn't even want to open the solution because of this problem, which greatly affected the efficiency and mood.

As a result, I added multiple projects to the tool for simultaneous editing. Similar to the concept of "workspace" in other software, besides switching the current project in multiple ways, it should be good to use a tab to display resources of different projects. When generating code, do not enter the information and path of the target code every time, because when I want to switch from Visual Studio to this tool, I can immediately locate the resource I want to edit and generate code by hand, directly generate to the resource project folder of Visual Studio solution, overwrite existing resources (. resx file and. designer. CS file), I switch back to Visual Studio to continue working.

At present, it has basically achieved my expected goal.

 

 

 

: Http://sailingease.com/ssr

 

 


Implementation of multi-language Resource Constraints Using Interfaces
when using the traditional getstring method or other equivalent methods, there is an uncontrollable risk of resource text access, especially in large-scale software engineering or collaborative development by teams, it cannot be ensured that all resource texts are obtained correctly and available. Such as misspelling and chaos caused by multiple revisions to resource files.

based on our experience, using traditional resource text retrieval methods, only a few hundred resource strings may lead to catastrophic loss of control and maintenance failure, one-by-one check is not possible, resulting in additional and high costs for the project.

consider the following:

the spelling of a resource is incorrect.
when modifying the resource file, the original resource file ID is modified, but not synchronized to the Program .
when revising the resource file, delete the original resource entries by mistake, or delete the entries that are not in use but are still needed somewhere.
unable to know the usage of a resource text: whether it is in use and whether it is used in multiple places.
when adding language resources, it is difficult to ensure full synchronization of resources in different languages, especially when the number of resources is large and the number of revisions is large.

the more project participants, the more prominent, you need reliable and controllable methods to ensure the quality of the project.

Se string resource is generated to solve the preceding problems and is also the fundamental purpose of Se string resource.

Access language resources through a management class (main class)
  In the main class, you can use the getlanguages () method to obtain all available language resources and the current attribute to obtain the resources currently in use. The method for obtaining all available resources is to obtain available resources through reflection. Therefore, the primary class only needs to be generated once, and then you can expand your functions on this basis, instead of re-generating the main class code.

For resource users, you only need to use the language. the current attribute allows you to access the currently used language resources without worrying about the specific language resources or whether the language resources are available or different, for more information, you need to worry about spelling errors when obtaining resources. Because these are all performed through the ilanguage interface.

In addition, the getstring () method allows you to specify the resource name through the string to obtain the resource content, which is particularly useful when binding language resources at the UI Layer.

 

Resource row Replication
  In se string resource, the copy and paste operations of resource rows are not simply copying one or more rows of data, but can identify the Regional Information carried during replication, if the region information on the target to be pasted is different from that at the time of copying, the system automatically matches the region information.

For example, if Project A contains "Chinese" and "English", and Project B contains "English" and "French", when project a replicates resource rows to Project B, the English resources in Project A can be automatically pasted into the English resources of Project B, while the Chinese resources are ignored. Even if the two projects only have different regional information order, they can be automatically matched.

 

Real-time error check
 

Se string resource can identify problems in resource entries in real time, such as invalid names and conflicting names.

In the error list, you only need to double-click the error entry to locate the error row, so that you can easily handle problems when dealing with a large number of resource rows.

With specially designed InspectionAlgorithmChecks are efficient and fast, even if thousands or more resource entries exist.

 

Export and Import Excel files
 

There is no doubt that exporting and importing Excel can make your localization work smooth.

In a very traditional resource processing technology, developers usually submit resource files in ini format, XML format, or even TXT format to translators for translation. In this way, developers cannot check whether the name of the resource line is mistakenly modified and whether the resource entries are deleted due to operation failure.

During the project iteration cycle, resource files are constantly revised and handed over to translators for translation (for example, new resource files during version upgrade, translators will also take advantage of past Translation results, increasing the chance of damage to resource entries exponentially.

In addition to the convenience of localization staff, when using EXCEL tables, se string resource checks whether all resources have errors when importing their translation results, because the resource usage of the project is based on the interface, if the resource entries are deleted by mistake, after the code is generated, your development environment (such as Visual Studio), during code compilation, an error will be reported directly to you.

 

 


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.