[TOOL] [WINDOWS] Android String Translator - IDEs, Libraries, & Programming Tools

Android String Translator
I wrote a tool that I sometimes use on my apps when I want to quickly and automatically localize a bunch of Android string resources. I call it Android String Translator, and it is a Windows utility compiled with .net 4.5 framework.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Disclaimer: After creating my tool, I saw that there were other similar projects here on XDA such as:
[PC][WINDOWS] ANDROID LOCALIZER - Translate Android App Easy
http://forum.xda-developers.com/showthread.php?t=2483990
Android APK Translation - CMD Line Tool
http://forum.xda-developers.com/showthread.php?t=1666630
So if my utility does not fit your needs, those above might. I do not claim that my application is better than any of the others (it could be worse for all I know).
Requirements
Android String Translator requires a Windows machine with the .net 4.5 framework. It also requires a Google Translate API key. The API key is not free (sadly). I think the cost is something like $20 per 1,000,000 translations. You can find more information here:
https://developers.google.com/translate/v2/getting_started
note: If people find this program helpful and want me to add support for alternative translation engines, I would be happy to do updates.
How to use it
The utility is pretty straight forward. First you enter your Google Translate API key at the top of the window. The box with all of the language codes is the list of languages that your app will be translated to. Then you select your root Android project folder. A list of all your .xml resource files will come up. Put a checkbox in the .xml files you wish to translate. Selecting an xml file brings up a list of resources in that file. Check each value that you wish to translate. If one of your strings is a comma separated list of values, check the CSV checkbox. When you are ready, hit the compile button and wait for it to do it's thing. It automatically creates the /values-xx folders in your project for each language. After you run the translator, remember to clean your project in Eclipse (if you are using Eclipse).
Machine Translation
Obviously this utility uses machine translation, so your results may vary. Machine translation is getting better, but a lot of people do not like it and advise against using it. Whether or not this app is good for your project is up to you.
Known Bugs
None that I know of, but I have only used it on a few small projects. To be on the safe side, you might want to back up your original xml files before running this tool. The utility itself should never touch the original files, but who knows what could happen. I make no guarantees or warranties on this thing. If you find bugs in the tool, let me know and I will see what I can do.
Ideas or Feature Requests?
If you like Android String Translator and would like to see it updated or improved, just let me know your ideas in this thread and I will try to make it happen. Chances are, if you can help me make this app so that it makes your life easier, it will probably end up making my life easier as well.
Security Warnings While Installing
When you are installing this tool, Windows bugs you that I am not a known publisher or something to that effect. On Windows 8 you can click on the 'More Info' button and then say 'Install Anyway.' I don't know the exact procedure on Windows 7 but I'm sure it's similar. I don't know how to make this go away or if becoming a known publisher to Microsoft will be more effort than it's worth. If anybody knows a way around this just let me know.
Download Link
http://market.ape-apps.com/zips/ast.zip

Pretty useful tool.
I was using google translator api to translate xml files with strings. And implemented a tool, to do it automatically. You can find it here: http://whyte624.com/translate/. Just upload file and download translations.
I know that it is not perfect, but pretty cool and advanced apps and games use this approach.

Bug & Issues
thanks man

Related

The Best Way to compare Old & New Registry?

Suggestions welcome!
Have you ever wonder, especially after you installed a new software, what are the registry that are modified?
1. Before install, study CAB file?
2. After install, check manually?
3. Have both Old and New Registry copied and use PC's FC.EXE?
4. Use text editor to open both Old & New Registry files in PC at window maximise mode, use ALT TAB and capture the difference with the Best Camera (your eyes) and Best Image processor (your brain)?
Here is my stupid way of doing it.
5. Have both Old and New Registry copied and use PC's M$ Winword, Document Compare feature.
Last Days of 2006
Happy 2007
Cheers
ssnap.
V
Hey, Thanks.
Learn a new thing again today.
I also recommend, as far as desktop-based tools are concerned, windiff.
I've even written a tutorial on using it: http://forum.brighthand.com/showthread.php?t=215073
Perl
This perl script will diff two textual registry files and show the differences.
(hmm no .pl allowed, rename from .txt)
Can't we just open the cab and see what it will add to the registry?
Lol, despite responding to this thread I've never read it
Yes, 100% agree with cellneuron. Decompile the cab, or ideally use WinCE Cab Manager to see what registry changes it will make.
V
hehe. What? Haven't you got time to read all of the threads each day?
anyway, yup, can't argue with that technique either. it never hurts to have too many tools at your disposal though.
Personally, I just found that reading the cab file registry entry format wasn't as clear as simply extracting the keys in .reg format. but that's just my preference.
The problem I've found with just looking in the cab is that sometime the exe files make registry and file changes too. So my vote goes with ssnap and idiff.
In the past I used regdiff and registry workshop.
pof said:
In the past I used regdiff and registry workshop.
Click to expand...
Click to collapse
In the past, what about now?
vijay555 said:
Lol, despite responding to this thread I've never read it
Yes, 100% agree with cellneuron. Decompile the cab, or ideally use WinCE Cab Manager to see what registry changes it will make.
V
Click to expand...
Click to collapse
Honestly, I also prefer t use WinCE Cab Manager to see the changes
Yeah, I'm a bit soft in the brain so prefer WinCE to cabtools,
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
but as the geeks point out, if I was making an installer I would probably hard code some of the registry entries, so won't be reflected in Cab manager etc. So use a standard registry dump and windiff them, or use ssnap.
V
http://s-k-tools.com/index.html?sktracker/m_feat.html
SKTracker this is program allowing You to trace changes on Your PocketPC.
As example, having done two records of the condition of the system,
before and after the installation of some software,
You will be able to learn about changes fom system.
You will be also able to use information for full removing software from system.
SKTracker features:
writing the current condition of the file system
writing the current condition of the registry
writing the current condition of the databases
comparison and suitable viewing result
start of Your file manager and registry editor from viewing window
a removing new or changed files and registry keys
keeping to information in compressed type
export information to text file
pre-defined rules
2 special rules for control of places of probable harmful programs intrusion (just in case)
shortcut wizard
support several languages of the interface
QVGA/VGA support
PPC2002/WM2003/WM2003(SE)/WM2005 compatible
SK Tracker
With SK Tracker you can Compare Files,Registry Keys
thanks 200mpx

Lost in the woods of developer tools - Please Help.

I'm trying to make a simple (or so I think) program. Essentially, it's a mobile version of the Run dialog you see on the PC when you press WindowsKey+R.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
And as you can see, I got the UI design in good shape.
The problem? I'm lost in the woods of developer tools! I'm not buying the way overpriced Visual Studio that nobody would pay for hobby/small projects. I'm sick of paying for upgrades of BASIC 4 PPC that still doesn't have what it takes to complete such a simple project (i.e. Shell command only loads programs, not documents or URL's.)
All of my programming experience has been in some form of BASIC, from ApplesoftBASIC on the Apple IIc and MS-DOS QBasic to VB6, VB2005/2008 and REALbasic. I decided to give PPL a try but all its documentation assumes you have as much programming exposure as I, but in C, not in BASIC. For example, getting that Open: edit field to populate with the file chosen in the File Open dialog was a torture as I tried to translate the appropriate VB statement into its equivalent C-style PPL statement, and actually getting the darn file executed is a nightmare that is still not over.
Is there any hope? Is there a mobile developer tool that can provide a balance between "easy to program" and "feature-rich", and that can create code for both touchscreen (Pocket PC) and non-touchscreen (standard Smartphone) WinMo platforms, without costing and arm and a leg?
I appreciate your recommendations.
Good luck with your quest. I was going to post Basic4ppc then read the whole thread lol
Have you tried SharpDevelop?
anikolop said:
Have you tried SharpDevelop?
Click to expand...
Click to collapse
Thanks. What a nice surprise. SharpDevelop seems to allow .NET CF projects for both C# and VB, something that the free versions of Visual Studio don't support.
That said, I created the project and started to add the code, but SharpDevelop won't run it - heck, it won't even run an empty window with no code. I'm hoping that's an issue I can solve by downloading the latest .NET CF from Microsoft.
EDIT: Downloading the tiny (yeah, right) SDK for .NET Framework 3.5... Hope that does the trick.
EDIT 2: The SDK didn't do anything, but the Power Toys were the ones that allowed Sharp Develop to compile my .NET CF code.
SharpDevelop .NET CF compile
I have installed Sharp Develop, NETCFv35PowerToys, NETCFSetupv35, Windows Mobile 6.5 Professional Developer Tool Kit , etc. When actually attempting to compile (to ARM) I'm not sure if I've missed setting some option in SharpDevelop, failed to install some tool, or made some other error, but Build just seems to produce an x86 Windows executable.
Neither Help nor Google seems to shed light on exactly what I need to do.
Pointers please.
Thanks,
Greg
Hey Greg,
.NET executables are platform independent. You need to choose .NET CF as the target framework and "Any CPU" as a target CPU in your project options.
".NET executables are platform independent."
Does .NET produce some kind of intermediate "P-code" that gets interpreted on the PC/WinMo? That would explain the complaints I've read about .NET programs being relatively slow. I'll have to try the HelloWorld.exe on my phone.
Thanks,
Greg
Yes, .NET programs get complied down to CIL, previously MSIL, a stack based, machine independant byte-code or P-Code.
All of this stuff is defined, search the net for "Partition III CIL" for a bit of light bedtime reading.
Use Red Gate's .NET Reflector, to open your HelloWord.exe program, and it will show you the IL code, as well as higher level code, VB C# Delphi etc.

[Q] Porting an CLI app to Android.

Hi XDA Dev's,
I have a program called words. It's a windows based, but ported to linux program which is able to function as an English to Latin and reversed dictionary.
The program has to be ran in the Terminal, cos it is command line interface based.
I thought since it is a program ran in the Terminal you should be able to run it in the Android Terminal, but that's just a theory.
Practically it doesn't work that way.
After untarring the app I entered ./words or su ./words but either won't work.
It gives me the following:
(I took the block from the internet so hope you see a block, not some kind of symbol: )
EL4: not found
4: not found
4: not found
: not found
./words: 5 Syntax error: "(" unexpected
So I think the Android Terminal reads differently cos it doesn't expect that character.
The question is: How can I port a linux CLI program to Android? And is this possible with the App Inventor from Google?
I don't really understand ypur question. If you would like to run a shell script try this
Code:
sh script.sh
Sent from my GT-I5700 using XDA App
Hmm sh gives me almost the same error.
But that's the thing, I have no clue what it is, there are a few files which are being used by the program. One of them is words, but it has no extension.
TT5555 said:
Hi XDA Dev's,
I have a program called words. It's a windows based, but ported to linux program which is able to function as an English to Latin and reversed dictionary.
The program has to be ran in the Terminal, cos it is command line interface based.
I thought since it is a program ran in the Terminal you should be able to run it in the Android Terminal, but that's just a theory.
Practically it doesn't work that way.
After untarring the app I entered ./words or su ./words but either won't work.
It gives me the following:
(I took the block from the internet so hope you see a block, not some kind of symbol: )
EL4: not found
4: not found
4: not found
: not found
./words: 5 Syntax error: "(" unexpected
So I think the Android Terminal reads differently cos it doesn't expect that character.
The question is: How can I port a linux CLI program to Android? And is this possible with the App Inventor from Google?
Click to expand...
Click to collapse
Hi, If you can get the source code to the program, then potentially the program can be ported to Android/ARM CPU architecture. The fact that it is a command-line program isnt such an issue - an Android app can be designed to interact with that (eg using Runtime.getRuntime().exec()).
If you just copied over the binary that runs ok under Linux on your PC, and tried to execute it on your Android device, it wont work. Your PC is running x86/x64 based CPU, your Android device is running ARM based CPU (eg you're putting diesel fuel into a car that needs petrol).
- jc
If I had the dictionary file, I could put it on my hosted site and write an app.
Rootstonian said:
If I had the dictionary file, I could put it on my hosted site and write an app.
Click to expand...
Click to collapse
You said it like it's that easy; but if you want I'd appreciate it.
The link on the official site doesn't work anymore so I uploaded the .tar.gz file on my website. Direct link:
http://www.freewebs.com/hoitom/words-1.97Ed-linux.tar.gz
Click to expand...
Click to collapse
I already made a concept of what it could look like with the App Inventor, but I don't mind else:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Note: this is only a English to Latin example. It has to be Latin to English too.
I hope you're able to do it. I'm really bad with linux.
Good luck
http://users.erols.com/whitaker/words.htm is the page for this program. It's written in ada and the author supplies the source. It will probably not be much harder than just compiling it for android once there is a working cross compiler, GNAT AUX is working on one currently http://www.dragonlace.net/posts/GNAT_AUX_ported_to_Android/.

[GUIDE][Android Studio] Using Google Android Maps API v2

NOTE : This Guide is Entirely Based on This Guide by Pavel Dudka on StackOverflow
Click to expand...
Click to collapse
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
As many of you would have already known, Google released a new IDE for Android App development named as Android Studio based on IntelliJ IDEA. But many have been experiencing some problems (including myself) while trying to use the Google Android Maps API v2. I finally followed a wonderful guide by Pavel Dudka on StackOverflow. So, i wanted to share the guide with you guys on XDA. So ... Here's the guide...
Take maps project from the Google Play Services samples and copy that to the separate directory. That is going to be our MapsApiV2 project we will be trying to run. It will be located at <sdk_location>/extras/google/google_play_services/samples. Place it somewhere. (eg: G:/workspace/ )
Copy the google-play-services_lib project directory to the same place (eg: G:/workspace/ ), so the working directory looks like this. Btw, lib project is located at <sdk_location>/extras/google/google_play_services/libproject
Now let's open Android Studio. On welcome screen press Import Project and import our maps project from G:/workspace/maps. Now we see a lot of complaints about unknown reference to GMS library:
Now we need to add Google Play Service as a reference library. Going to View -> Open Module Settings
On the Modules tab, click + button and select Import Module and import your GooglePlayServices lib. I didn't change anything in the wizards, so clicked Next all the way to the end:
Now you need to reference this imported library. Open this screen again (go to View -> Module Settings). Make sure you have your maps project and Dependency tab selected. Click + to add a dependency and select Library. Choose your imported library there:
Now we can see that it is not complaining about GMS library, but still complaining about support library:
Let's fix it. I have my support library located at <sdk location>/extras/android/support/v13/android-support-v13.jar. So let's try to add it to our workspace. Go to View -> Open Module Settings and select Libraries tab. Select + -> Java and select support library:
Now it is going to ask you which project to add this lib to, so make sure you have selected your maps project:
Now, You should be able to compile the maps project without any error. :good:
Reserved for updates
Sorry... Reserved for updates
Hey @niranjan94, i have do step for step of your guide but i get errors that the gms.maps packages not exist? I hope you can help me

[Pictorial] [Java] Learn how to create custom FileFilter for .APK files.

Hey there, guys!
It's been a while since I've posted something, and Universal Android Toolkit is coming along nicely, so while I'm coding it, I decided to create a pictorial, to show you how you can create a FileFilter for Java JFileChoosers, which are used to detect ONLY .APK-files. Of course you can extend this in any way you choose.
So, let's get started!
Prerequisites:​
An IDE (Preferrably NetBeans IDE)
Basic Java knowledge.
A project. (And in that project
One (or more) JFileChooser.
A way of working with the JFileChooser (a JButton or similar)
An empty class somewhere.
Once you have all that set up, open up your new (empty) class.
It should look a bit like this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Now, before we get on to the coding, we want to tell Java, which type of FileFilter we want to use.
So, we're going to import the following line:
Code:
import javax.swing.filechooser.FileFilter;
It should look a bit like this:
Now, don't freak out over the unused import, that's what we're going to fix, now.
Behind the name of your class (the class identifier), type following code:
Code:
extends FileFilter
If you're ising NetBeans, you'll notice the little error-bulb on the side. To make life easier, click on it and implement all the abstract methods.
If your IDE doesn't have this feature, just type the code from the picture below:
Now, you'll notice that the class is missing a few things.
These things are:
a constructor
a description
a list of file extensions.
But fear not! Here they come!
At the top of the class, create two variables.
One should be a String variable, called description (or whatever you like, to be honest.),
and the other should be a String array called extensions (or whatever you like).
Then, create an empty constructor, as this FileFilter will have everything pre-defined.
Ok! Now that we've got that sorted, let's add some real code to the methods.
Ok, this is what we want the method accept(File f) {} to do:
Check if the file is a directory or not.
If it isn't, check if the file has a valid extension and whether it should be shown.
If everything's OK, then show (accept) the file.
And this is what we want the method getDescription() {} to do:
Show the description of the file type to the user.
This code is very simple and not hard to understand.
But I've commented it, just to be sure.
EDIT:
As @AdamOutler mentioned below, you can use this code instead, and, if you've got a slow(ish) computer, this might also speed things up.
Code:
public boolean accept(){
return file.isDirectory() || file.getAbsolutePath().lower().endsWith(".apk");
}
So, thanks to him!
Now that we've got our FileFilter finished, let's go ahead to our button and do something!
First, make sure you have imported the class we just created.
I created the class in the package eu.m4gkbeatz.androidtoolkit.io, so that's where I have to look for the class.
Now, create an ActionEvent or some other method, so we can test our JFileChooser's FileFilter.
Once you've got all that done, let's enter the code we need, in order to test our JFileChooser.
Now let's test this!
First, debug your project and make sure it runs error-free:
(Note, you will see a WIP-build of Universal Android Toolkit. I was so busy doing the design and other projects, I haven't quite added alot of controls to it, yet!)
https://db.tt/nyaS6buQ
And then click your button (in my case, the gray one with the three dots) and test the JFileChooser.
And voilá!
If you followed the code properly, you should have done everything right!
If you liked this tutorial, don't forget to shoot me a Thanks!
If you need help, contact me via my Facebook page, Twitter or reply here, so everyone can see your issue.
To view the entire file, click here!
EDIT:
I was asked what rig I'm using, because of the OS X-like design, so I thought I may as well write it here, so no confusion occurs.
I am NOT using Windows.
Instead:
Kubuntu 13.10 x64
KDE 4 Completely Oxygen
The window LAF is Oxygen OS X, found in the System Settings.
It might simplify things a bit and reduce processing time to use this...
Code:
public boolean accept(){
return file.isDirectory() || file.getAbsolutePath().lower().endsWith(".apk");
}
Note the .lower(), which will cause it to recognize any combo of apk/APK
AdamOutler said:
It might simplify things a bit and reduce processing time to use this...
Code:
public boolean accept(){
return file.isDirectory() || file.getAbsolutePath().lower().endsWith(".apk");
}
Note the .lower(), which will cause it to recognize any combo of apk/APK
Click to expand...
Click to collapse
Ah, thanks!
Didn't think of that, before. I'll add it to the OP.

Categories

Resources