Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [swtbot-dev] Where to get translated string for File..Preferences etc?

Depending on how these things are configured it can be in a few places:

If the contribution comes from a plugin.xml directive, you'd likely find it in a plugin.properties file within the plugin or a plugin_LANGUAGE_CODE.properties in a language fragment.

If the contribution is configured using code, for e.g. strings on a button or label on a dialogs, these would most likely be in an internal package, and the keys to lookup strings may likely change across versions.

More about it here: http://wiki.eclipse.org/Internationalization

If you really want to internationalize strings, I'd *highly* recommend creating a message bundle for all strings that your tests refer to. It's a lot to translate a string into half a dozen languages than figuring out where a particular string is internationalized and what the lookup key is.

Based on prior experiences, I'd not test international strings from plugins I did not write myself, and probably even force all tests to run in a single language of your choice. The tests become unreadable and unmaintainable beyond a certain point.

--
Ketan
http://ketan.padegaonkar.name | http://eclipse.org/swtbot

On 5/19/10 11:55 AM, Niklaus Giger wrote:
Hi

I have some small tests running for our RCP application (www.elexis.org).

Before adding more stuff I would like to have resolved some issues.

One of my priorities is to run SWTbot in different languages (taking
screenshots along the way).

For my own classes it is easy to write things like
ch.elexis.laborimport.analytica.Messages.getString("PreferencePage.title.description")

But where do I get the translated string from for something like
	bot.menu("File").menu("Preferences").click();
Running the test in German using
	bot.menu("Datei").menu("Einstellungen").click();
works fine.

IWorkbenchActionConstants.M_FILE returns '!file!'

I know this is maybe a little bit off topic, but I tried a few hours to find a
solution and do not know where to ask.

Would it be a lot of work to improve SWTbot to try to find automatically
translations when calling stuff like
bot.menu(IWorkbenchActionConstants.M_FILE)?

Thanks in advance for your advice.

Best regards





Back to the top