Translate XLIFF file into specific language xcode - ios

I'm doing localization in my IOS App,My xcode has created xliff file from export for localization and I have multiple file like this...
as content of es.xliff is like this..
</header>
<body>
<trans-unit id="1A8-nz-WtR.placeholder">
<source>E-mail*</source>
<target>E-mail*</target>
<note>Class = "UITextField"; placeholder = "E-mail*"; ObjectID = "1A8-nz-WtR";</note>
</trans-unit>
<trans-unit id="1gB-DL-EAz.title">
<source>Add Location</source>
<target>Add Location</target>
<note>Class = "UINavigationItem"; title = "Add Location"; ObjectID = "1gB-DL-EAz";</note>
I want to translate it in spanish which software will do that or is there any way.I had browsed but no success.

You will need a XLIFF Editor - check out http://xliff.brightec.co.uk/ - it's online, it's free and does the job.
You'll still need to manually translate each entry.

I prefer to export XLIFF to Word (docx format), send Word document to translator on Fiverr a then import translations back from Word document to XLIFF file. https://129bit.com/home/xliff-to-word-and-back

I found a workflow that works really well. I downloaded Swordfish and signed up for their free trial. Swordfish is an XLIFF importer, editor, and exporter. Swordfish also works with machine translation engines like Google, DeepL (which I have read offers superior translation capabilities compared to Google - YMMV), Microsoft Azure, and others. I signed up with DeepL and got their API key as part of their one month free trial. I imported the API key into Swordfish. I was then able to use XLIFF files that I exported from XCode, import them into Swordfish, do the machine translate, verify the translations, then export the file. I then went to XCode and imported the updated file.

Related

Xcode localization - how to create localized strings for development language

Using Xcode 7's localization export workflow, I can export to Xliff, which can be provided to translators, who will give back a translated version, which we import again.
However, how do I generate one for the original development language?
I want to do this so that I don't have to maintain my development language strings files manually by hand.
Here is the scenario:
I start with no strings file in my project, just Swift code which uses the NSLocalizedString
static let something = NSLocalizedString("something.hello", tableName: "MyStuff", value: "Hello world!", comment: "some comment")
From the project settings, I choose Editor -> Export for Localization. Because I have no existing strings files, when I export, there are no options. Just a "save as" prompt.
This will perform an Xliff export from the original source code. (Same as when you choose "Include: Development Language only" from the prompt when other localizations already present). The Xliff looks like this, with only <source> tags, and no <target> tags.
<trans-unit id="something.hello">
<source>"Hello world!</source>
<note>some comment</note>
</trans-unit>
The Xliff file is modified by translators, and translated to simplified chinese
The translated Xliff file is re-imported into project via Xcode
This creates the MyStuff.strings file for simplified chinese
Problem - when I run the app, the app will use the chinese strings file, even when language is english, because an english file doesn't exist. It doesn't seem to use the default value anymore. This means I need an english strings file too.
How can I generate an english (the development language) version of the strings files through the import/export process? Xcode doesn't let me "export" in the original development language. So I can't re-import it to create the strings files.
Note on genstrings
In the documentation for Separating User-Facing Text from Your Code, it says "Alternatively, you can generate the development language strings files from NSLocalizedString macros directly, as described in Creating Strings Files for User-Facing Text in Your Code." , which tells you to use genstrings
However that genstrings no longer works for Swift when you specify the tableName.
It's my understanding from what I've seen on SO that multiple radars have been filed, but it seems Apple is no longer supporting it.
I've worked out the problem.
It's doesn't seem necessary to generate strings files in the development language. This must be why the capability doesn't exist in Xcode.
My problem was that the app didn't think that my development language (english) was supported, so it did further fallback, and ended up picking a language that my app was localized for (in this case, chinese).
By adding a file localized for english, and ensuring there is an en.lproj folder in the bundle, it infers my app is localized for english, and will correctly use the default values specified in the NSLocalizedString calls.
This means I don't need a seperate copy of the english strings files. Which is great, because I won't need to keep that up to date as the app changes. The source of truth is the Swift source code only.
This link was helpful:
How does iOS determine the language for my app

iOS- How to translate english (.string file) language in different languages at a time?

I am facing a problem. I am working on an app which is supported around 30 languages. I have tried google toolkit translate (https://translate.google.com/toolkit/ ) but it is not working properly. For example let assume in .string file I have 40 lines of codes. If I translate language using google toolkit then it converts just 4-7 lines sometimes 8-9 times and so on. Others all lines it skips. Please let me know how can we translate English language in multiple language (around 30) at a time. Please share Any tool name or site name. Thanks guys.
Here is a project which can convert your localization.strings file to any language using google translation api.
You just need to copy paste all the data of localization.string file into a txt file. and add that txt file in app bundle file and specify file name in Constants.h file. Also mention the google translator api key. You can also mail the translated file.
Localization using google transtion iOS Project Link

compare two .strings file for finding missing keywords

I have two .strings files in my application for supporting both persian and english language in my app.
For example I below files
en.strings:
"HELLO"="heloo";
"THANKS" = "thanks";
and another one
fa.strings:
"HELLO"="سلام";
Is there any tools in xcode that let me know that fa file do not contain THANKS keyword?
If you actually export and import localisation files, xCode will set them for you, as well as deleting the unused ones. No need for any tool.

Xcode 6 - Base internationalization -exporting and importing en.xliff file

My app only supports english. I am using base internationalization (English- Development Language)
Steps I followed:
1. Separate out user-facing text using NSLocalizedString();
2. Using Genstrings command i have added Localizable.strings in base.lproj.
3. In Editor >> Export for Localization
4. Save en.xliff and provide to translator team for updating English content
5. While importing updated en.xliff file, i got below error.
Might be i doing in wrong way to export/import for English. Please suggest me the best approach for handling English content. (development language).
It is not obvious to me what you want to achieve: do you want to have your strings translated into some language other than English, or do you want to run your strings through an English linguistic review? For the first case the error message is pretty clear: check if the file element in your translated XLIFF file has a target-language attribute and add it if not. Details about this attribute can be found in the XLIFF spec here.
If adding this attribute is not enough you may also want to look at the answer to this previously asked question.
For the second case XLIFF is not really a good format.

Can't find a working free xliff editor for OSX Lion

Attempts
I tried:
Virtaal
PoEdit (not xliff but convertible)
Open Language Tools TransEditor
LocFactory Editor
And I think I'm getting nuts.
Virtaal
With Virtaal it seems I can't create files (or am I to stupid ?). Also when I open the tutorial .po and try to save that, Virtaal crashes.
PoEdit
With PoEdit I can create a new project but on finishing he throws me an error:
Poedit did not find any files in scanned directories.
Entries in the catalog are probably incorrect.
Updating the catalog failed. Click on 'More>>' for details.
Open Language Tools TransEditor
And in Open Language Tools TransEditor I created a new project but I can't create any new lines/translations.
LocFactory Editor
I also tried LocFactory Editor. When I launch it I get
No document could be created
And in the menus I also can't find anything like New File or so.
Question
So what is that ? Am I to dumb to create xliff files using an xliff editor ? should I google for xliff creator or what ?
Requirements
I want to have xliff files for a FLOW3 project.
I'd like to use an editor that supports plural forms.
Support for Mac OS X
Hi you can try this one
XLIFFTool
You may want to try OmegaT.
It's not just for XLIFF, but it should work reasonably well with XLIFF documents.
Make sure the elements have a copy of the text to translate before opening the file in OmegaT. You can also use Rainbow to create an OmegaT project with XLIFF files: it will add the copy of the source text for you.
Hope this helps,
-ys
There is free XLIFF online editor at Brightec. Not sure about plural forms support.
you can use poedit tool for that.

Resources