Import from resx, resw, resjson, and csv files so I can use translations from other non-xliff based projects.
I have apps with translations that are stored in resx and other file formats. I would like to use those string in my newer apps. Importing (or recycling as you call it) would allow easy access to my existing app translations.
CSV import is still planned, but other formats are downgraded to under review. We see the value, but there are several challenges with the request. We will look at additional solution in the future.
One of the problems that we face during any import is about translation content and alignment. For example, importing a translated RESX file into a project is not possible to do correctly. This is because the RESX format only contains a limited set of data required to do the work correctly. Assumptions can be made, but that is what they are. Key trouble points are: A translated resource is not linked with a source string, source language or even a target language. Even if we cross reference the main language resource file using the ID, we don’t know if the source string was changed since the RESX file was translated. Additionally, the process would not even know if the source and target languages are still correct. Filename formatting, timestamps, etc. can be used to make assumptions, but there is a very high risk for cross importing – which would be worst than machine translation (IMO) since the context or meaning is guaranteed to be different. This is even worse if the imported RESX file is applied to a different project, which is seen as the main usage model.. Since we only have the Resource ID + Translation value, we don’t even know if the same resource ID + Source value in the other project was ever related to the RESX file being imported. This is the main reason why we use XLIFF for MAT. It contains all the metadata necessary to ensure a high confidence level during the import.
I created a utility this morning that will convert translated resx files into related XLIFF files. This will allow importing of the created XLF files into different projects as long as the "Enable resource recycling' checkbox is selected.
The utility has been spot tested and is considered preview quality. If you want to give it a try, please email email@example.com and I'll send you the preview of the utility.
Olivier Le Pichon commented
Yet in this situation in 4.0 update 1.
My current projects contains resx with already translated content. I could be interested in using MAT to add new localization but activating it on this projects clear existing resx.
Martin Suchan commented
This is the essential feature that I am missing in the app right now, let me explain.
I got a WIndows Phone project with about 30 .resx strings, currently localized into about 15 languagaes.
I made an update of the app with another 15 strings and I want to localize these strings into each language, but I want to reuse the existing translated strings.
This is not possible right now with MAT.
There must be one-click option in the MAT to generate xliff files for my existing .resx files, it's simple as that.
And regarding your note that this is high-risk operation, it really isn't. All .resx files contain the same keys as the reference en-US file, so it's just a matter of importing 15 key-value collections, nothing complicated.
I also have a project with existing .resx / .nl.resx / .de.resx / .en.resx / .da.resx / ... files
I want to import my existing .resx files the first time:
This functionality is not gone for ever. It is a know bug in the technical preview. We will be fixing bug like this as we move towards beta level code.
PS: Love the workaround!
Brandon H commented
Am I missing something? Up until v4.0, I could take RESX files and drop them in to my MAT-enabled project and MAT would auto-create the XLF variants as they were added to the project.
I see in v4.0, however, this is now gone. Am quite disappointed in this...
Okay just in case someone needs this: I wrote a little console app to do the one time import of resx/resw into xlf. First parameter is the resx/resw, second parameter is the target xlf file. This assumes that the xlf file has been pre-populated with values, so build the solution once to get the defaults into xlf and then run this program for the import of the values.
static void Main(string args)
var reswDoc = XDocument.Load(args);
var sourceEntries = reswDoc.Root.Elements("data").ToDictionary(e => e.Attribute("name").Value, e => e.Element("value").Value);
var xlfDoc = XDocument.Load(args);
var targetEntries = xlfDoc.Descendants().Where(d => d.Name.LocalName == "trans-unit").ToDictionary(e => e.Attribute("id").Value.Substring(10).Replace('\\', '.'), e => e.Elements().Skip(1).Single());
foreach (var entry in sourceEntries)
var target = targetEntries[entry.Key];
target.Value = entry.Value;
target.Attribute("state").Value = "signed-off";
This is totally needed. I have already translated 250 strings. Now I want to switch to Multilingual App Toolkit and I have to copy/paste all these 250 strings manually for all languages except the default language? No way! We definitely need a way to one-time import resw and resjason into xlf. This does not have happen automatically, no "synchonization" needed. I do not see what assumptions are needed here. I open a xlf file. I click on import translations from resw, I select the correct translated resw file. Everything is imported. Maybe add an option to decide which status the messages shall get, but some default would be ok to get started.
I'd even go so far and not only import but also export/save to .resx files and therefore make MAT a bit more generic.