How to check which localization strings are really used in iOS Application? - ios

We have a legacy application for iOS translated to two languages. After checking the localization files we realized, that there are a lot of strings that are not really used in the application, though, we cannot be sure which ones.
Is there some way (maybe some utility) that can check objective-c project and localization files and check which strings re really in use and which are not so we can delete the from the localization files?
Thanks

You could use genstrings to generate a new strings file from your project and then use one of the string-files comparison/merge tools to find the differences.

Related

Cannot automate localization in my iOS generated App

I am generating an iOS app via some tools. No need to concern about them, I have to do things that way.
Localization
The app is generated just fine, however I need to have the app be available for a certain set of languages. My app is actually a cross-platform app, and i am handling translation at JavaScript level. So my app actually picks the proper strings.
I just need to have my app be recognized in the Store as supporting those languages
Manual approach
I used to handle this by automatically generating language folders in Resources. So my automation scripts, would basically take the list of supported languages (say it, en and fr) and generate the following folders and files in my project:
MyApp
|
+-MyApp-Info.plist
+-Resources
|
+-en_US
|
+-Localizable.strings
+-it_IT
|
+-Localizable.strings
+-fr_FR
|
+-Localizable.strings
And Localizable.strings is just a placeholder file with a C-style comment in it.
Not working anymore
This did the trick so far, but now it is not really working anymore. The store recognizes my app to be only an English app, it does not list French and Italian anymore.
I am targeting iOS 8.0+ and developing on latest version of XCode.
How can I fix this?
Try renaming the localization folders so they have the ".lproj" suffix. Use the naming scheme as defined in the Apple Internationalization and Localization Guide under Managing Strings Files Yourself.
I would also add at least one string resource in the Localizable.strings file for at least one of the languages. At least one localized string resource may be needed to flip the bits and mark the app as supporting the additional languages.

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.

Verifying what strings inside all localizable.strings files are obsolete

I have project that has several years. Over the time, the app has been modified, some classes added, some removed, etc. This app is localized in 5 languages.
Is there a way to scan all localizable.strings files and detect which strings inside these files are not used anymore in the project?
thanks.
Yes there is a way! Basically, you have to dump the .strings using commands and then compare them to acceptable versions. For more details, see here: iphone - cleaning the Localizable.strings

Is there a program to automate localizations for xcode?

I have been using Google's Translation web site to translate my localizable.strings file to multiple languages, but it is very tedious.
Does anyone know if there is a better way to do this?
Don't do that! Most people will prefer a non-localized English version to a poorly translated one.
Either contact a localization service (they will translate the .strings files directly) or don't localize your app.

iPhone localization at one go

Is there any other way to localize iPhone apps beside the use of Localizable.strings? Can I use Google Translate or something like that?
I have my application written in English, and I have created Localizable.strings files for about twenty languages. I have the English Localizable.strings working perfectly, and I have tried Italian as well. Is there any way to translate these Localizable.strings to the rest of the languages automatically?
I mean is there any program or something to do the job for me?
In short: No, there is no program for that. It's the same problem as translating any text: You need to understand the meaning to give useful translations.
As a quick fix, you can of course simply take the strings in your Localizable.strings file and copy them into a Spreadsheet, then run one column through Google Translate and copy the result back. Then reverse the procedure and you have a translated Localizable.strings. A regex for doing this would be:
^"(.*)"\s*=\s*"(.*)";$
that works fine in eg. TextWranger with grep mode on, then you can replace the text with
\1\t\2
to create a the tab-delimited file from a strings file.
I still suggest you invest in a native speaker of each language to double-check the translations, or your app will become a laughing stock. Google Translate just can't replace a real human yet...
To localize your app you can use Localizable.strings or use localized XIB.
I don't use the second approach because it is more cumbersome to manage.
With Localizable.strings you have to code a little bit more but I prefere it.
To translate I think you can use google translate (I do that) and build the file for each language.
If you want to use an online translator, remember that it can be not always available and your user must be connected all the time.
So my advice is to build all the language files since they are managed by the OS and you will have a more reliable solution.
You should create Localizable.strings for each language and translate them with any translation tool

Resources