Skip to content

Internationalization (i18n) #2084

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Jul 31, 2014
Merged

Internationalization (i18n) #2084

merged 19 commits into from
Jul 31, 2014

Conversation

nok
Copy link

@nok nok commented Sep 17, 2013

Hello, Hallo, Salut, Cześć.

How to change the language?
Change the language in the preferences CMD + , of Processing.

How to use a translation?
Just type Language.text("object.name");, anytime, anywhere. (It uses the singleton pattern and it's independent (It uses a separate file /lib/language.txt to store the favorite language).) You find the object.name in the package processing.app.languages, where every language is located as a properties file. If the specific language doens't have the translation (i.e. menu.file in PDE_fr.properties), the system will extend the default translation of PDE.properties. The default language is English.

How to add a new language?
1: Add the language ISO 639-1 code (list of codes) and name in processing.app.Language, i.e.:

// de, Deutsch
this.languages.put(Locale.GERMAN.getLanguage(), Locale.GERMAN.getDisplayLanguage(Locale.GERMAN));

2: Add the file PDE_de.properties with translations in processing.app.languages.

Note
It's a initial version of that extension. I hope, that you like it.

Happy coding,
Darius

@aengelke
Copy link
Contributor

Perhaps you could add an option to change the language independent from the system settings?

@nok
Copy link
Author

nok commented Sep 18, 2013

preferences

preferences_de

At first time the editor checks your local system language. If it matches with a available language, you will see the PDE in your local system language. Otherwise you will see it in English.

@datguy
Copy link
Contributor

datguy commented Oct 5, 2013

I like it. I hope your pull request is accepted.

@nok
Copy link
Author

nok commented Jan 21, 2014

Hmm, I keep that extension in mind, but I don't know how to handle the next steps. I think, that it's very useful.

@REAS What do you think about that extension?

@REAS
Copy link
Member

REAS commented Jan 21, 2014

Darius, this is for @benfry to evaluate. Best, Casey

@benfry
Copy link
Contributor

benfry commented May 12, 2014

Thanks for this! Would you be interested in updating it for the current source?

@nok
Copy link
Author

nok commented May 12, 2014

Currently I'm low on time, but yes, I'm going to extend it next week (2014/June/03).

@benfry
Copy link
Contributor

benfry commented May 13, 2014

Thanks!

@nok
Copy link
Author

nok commented May 21, 2014

I updated the source from the remote master branch and merged/improved it with some extensions/changes. Looks fine. 👍

Happy coding,
Darius


pde
preferences
libraries
_file
_edit
_sketch
_tools
_help

@benfry
Copy link
Contributor

benfry commented May 21, 2014

Thank you! We're about to switch over to 3.x development, and I'll merge this in when we kick off that process.

@nok
Copy link
Author

nok commented May 21, 2014

Okay, great!

@tyfkda
Copy link
Contributor

tyfkda commented Jun 26, 2014

Hi @benfry ,
I really want this pull request get merged into official processing repository,
because I want to add Japanese language to Processing.

I think it is needed to add a rule to convert .properties files to include them into pde.jar:
https://github.com/tyfkda/processing/commit/d713e00a3eb93b2aaf2c6944d6d73edf73a7f70a

I have tried this pull request merged into the currentHEAD,
and I confirmed it runs correctly.

@benfry
Copy link
Contributor

benfry commented Jul 30, 2014

Thanks again for this, I'd like to merge it into the repo. A couple small things that need to be fixed first:

  • it looks like PDE_de.properties isn't using UTF-8 encoding, please fix (or verify)
  • several .class files were included in the PR, which we don't want
  • SerialFixer.java and VariableInspector.form seem to have re-emerged from an old commit
  • mode/experimental is now gone, that code lives in the root at /pdex
  • a machine-specific entry has been added to the .classpath file in the root

Please take a shot at fixing these up and re-submitting when you can. I'd love to get this integrated soon. Thanks again for your help!

@nok
Copy link
Author

nok commented Jul 31, 2014

Hi Ben, thanks for the hints, I'm going to consecutively fix these.

@nok
Copy link
Author

nok commented Jul 31, 2014

Okay,

I hope, that I didn't forget something ... please check out the i18n branch, build and test it too.

Happy coding,
Darius

benfry added a commit that referenced this pull request Jul 31, 2014
Internationalization (i18n)
@benfry benfry merged commit 6a4adfb into processing:master Jul 31, 2014
@benfry
Copy link
Contributor

benfry commented Jul 31, 2014

Now merged; here goes! I'm super excited about this.

@benfry benfry mentioned this pull request Jul 31, 2014
@REAS
Copy link
Member

REAS commented Jul 31, 2014

Entirely awesome. How do people add other languages? @voidplus could you write a Wiki page about that? http://wiki.processing.org Or, am I missing something?

@nok
Copy link
Author

nok commented Jul 31, 2014

I'm glad too. 👍

Yes, I'm going to write a short howto page this week.

In addition I want to create a small interactive website, where people can fill out "pde-forms". I think, that's the easiest way, how contributors can help.

@genekogan
Copy link

has anyone considered translating processing/java syntax in addition to the file menu? e.g. "void", "setup", "draw", "return", "vertex", etc. since the IDE already has a parser built on top of it to convert to java, setting it up to parse different languages should be straightforward, and i think speakers of other languages may find it welcoming and more accessible than english-only.

also, i think i should be able to contribute a russian version.

@benfry
Copy link
Contributor

benfry commented Aug 1, 2014

Short answer is that we've done that in the past (http://dbn.media.mit.edu/) and it wasn't as useful as we'd hoped. Longer answer is that it's probably something better discussed as a suggestion on the forum.

Would love to add a Russian translation, thanks!

@nok nok deleted the i18n branch November 8, 2014 00:26
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants