locked
Localization of Web API RRS feed

  • Question

  • User957067744 posted

    Hi everyone.

    I would like to know how does process of localizing apps is done in real life. And I'm talking about huge apps (web, desktop, whatever) with many supported languages where you need external translators to translate app for you. I'm having web api that I want to be localizable so I'm starting thread on this forum. I know that translation may be done by the client side, but this is the way I want it. I've heard that using resource files is a way to do it. So I created Resources folder, put in it Resource.resx, defined some kev/value strings in it. I also added for example Resource.es-ES.resx. And when I'm accessing some resource string, I'm doing it like this:

    string message = Resources.Resource.ResourceManager.GetString("MESSAGE_KEY");

    Is this right way to do it? I know that there is fancy way using attributes, but have to set value to a property of a class in external library. But most important questions is how is this translated by the external collaborators? I don't expect them to make their branch, open solution in visual studio, open appropriate resx file and start translating. When I build my app I see that folder 'es-ES' created with some resource .dll in it. What is this dll? I dont see any .xml file representing my es-ES resource file. So how are they doing this?

    Kind regards

    Thursday, May 21, 2020 7:53 AM

Answers

  • User-719153870 posted

    Hi Frodo,

    Do you know is there some translation tool that can generate either resx files or satellite assemblies?

    Google translation editor to resx and you will find many translation tool that can handle resx files.

    For example, Resx Resource Translator might be what you are looking for.

    Best Regard,

    Yang Shen

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 22, 2020 2:44 AM

All replies

  • User753101303 posted

    Hi,

    A web API is about data so it's bit weird to have translation there. Make sure you are not talking about data. Else it depends. You have things such as https://en.wikipedia.org/wiki/XLIFF but I used once just Excel sheets (it was coming from subsidiaries inside a company).

    Once you have the proper data it's quite easy to transform them as neeed. For example it seems MS uses a central database: https://www.microsoft.com/en-us/language and they may create resource files based on that.

    Also "resource files" as many things in .NET is a default mechanism that could be replaced. A custom "resource provider" could get translation data from some other source using the same basic mechanism.

    If really data it is rather handed at the db level. For example in a db we have a main row for non translatable data and then at least one language version. Users can then request another language version (which will end uup on its own row in the same table as a child row for the same main item).

    Edit: even if not using ASP.NET Core it is always interesting to see what's available. For example https://docs.microsoft.com/en-us/aspnet/core/fundamentals/localization?view=aspnetcore-3.1

    It's uses a simple interface so that you could plug whatever best fit at any time and you may want to use something similar even if using ASP.NET 4.x

    Thursday, May 21, 2020 12:51 PM
  • User957067744 posted

    But if we put central database aside, who is translating some complex messages? Lets say i'm building ASP.NET MVC app. For example, I want to show user specific message that more complex then a word, so I need someone to translate it for me, how is it done? Does that person translate it and I put it manually in resx?

    Thursday, May 21, 2020 1:08 PM
  • User475983607 posted

    So you're question has to do with MVC and not API?

    But if we put central database aside, who is translating some complex messages? 

    I've built multi-language sites and generally I know who to contact to translate content.   

    Lets say i'm building ASP.NET MVC app. For example, I want to show user specific message that more complex then a word, so I need someone to translate it for me, how is it done?

    In the past I used Excel, email, and the dev site for context.  The Excel workbook contains the content to be translated.  When the workbook is sent back it contains the translations.  For content stored in the database, I'll create an edit screen so the translators can insert the translations.

    Does that person translate it and I put it manually in resx?

    The translator would need access to the project files and have an understanding of how resource files work and what pages they belong to which is doubtful but doable. 

    Thursday, May 21, 2020 1:26 PM
  • User957067744 posted

    Well my question is about localizing using resx files. It doesn't matter if its asp.net mvc, web api or desktop app. What I meant by asking who is doing the translation, I meant who is putting resource strings in resx files (satellite assemblies) at the end - is it developer or non-technical person (translator)? Or maybe some external app that generates satellite assemblies? That is what I don't understand. I've never done localization. I know that app must be coded in a way that its localizable (regardless if I'm using resx files or some other technique) and i think I know how to make it localizable. But what I don't see is when I'm using resx files, how can translated strings end up in those resx files other then directly putting them in there? And it would be very strange to me if non-technical translator would do that directly by opening solution in visual studio. And again if developer is giving a list of strings to be translated, translator gives him back translated string and developer puts them manually in resx files it seems that there is job that is being done twice.

    Thursday, May 21, 2020 2:33 PM
  • User-474980206 posted

    It all depends on how much needs to be translated and how many languages. In a large project, you would build or buy a translation tool. generally the files are xml or json, and another tool is used to imbed in an application.

    for example for javascript

    https://github.com/jcbvm/i18n-editor

    Thursday, May 21, 2020 2:42 PM
  • User957067744 posted

    Ok, this sounds logical to me. Do you know is there some translation tool that can generate either resx files or satellite assemblies?

    Thursday, May 21, 2020 3:07 PM
  • User-719153870 posted

    Hi Frodo,

    Do you know is there some translation tool that can generate either resx files or satellite assemblies?

    Google translation editor to resx and you will find many translation tool that can handle resx files.

    For example, Resx Resource Translator might be what you are looking for.

    Best Regard,

    Yang Shen

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 22, 2020 2:44 AM
  • User957067744 posted

    Thank you PatriceSc, mgebhard, bruce and Yang for your effort and answers. I marked Yangs reply as answer, but its more combination of that reply and bruces.

    Friday, May 22, 2020 6:58 AM