On May 15, 2008, at 11:46 AM, Daniele Corti wrote:

2008/5/15 Rams <[EMAIL PROTECTED]>:
Almost there I think...

That works, but now my sessionless localizer in my ERXComponent is broken.

<wo:str value = localizer.LOCALIZED_KEY />

returns English strings in both components where

Because when you change ERXSession.setLanguage() to Japanese, or using Properties file er.extensions.ERXLocalizer.defaultLanguage (hope i've written it right), only the ERXSession.localizer change the language. In order to change the sessionless component you need to use ERXLocalizer.localizerForLanguage("Japanese"), when call it in your component.

I don't follow.... I'm not touching the language settings programatically at all. I'm testing this by changing my system language from english to japanese in the Internationalization prefspane. I do have

er.extensions.ERXLocalizer.defaultLanguage=English

in my properties file, but the sessionless localizer.KEY works fine in a non-localized component. Only when I localize the component does the sessionless localizer break.

I suggest you to do this onnly if you REALLY need to have a sessionless component:

Well, I would very much like to have bookmarkable URLs in my app. I'm under the impression that in order to do that, I'm going to have to default to direct actions instead of using component actions and creating sessions everywhere. I'm curious as to how to handle a bookmarked url with a session in such a case, but I think that is a whole other thread worth of discussion :-)

public String language; //assume this contain tha language you want to use

public ERXLocalizer localizer()
{
     return ERXLocalizer.ERXLocalizer.localizerForLanguage(language);
}

then when you call <wo:str value="$localizer.KEY" /> you'll get the correct localized string.

Eventually, I do plan to implement a language menu so the user can select a different language, but I would like to greet them with their default system language.

<wo:str value = session.localizer.LOCALIZED_KEY />

It would be usefull to use ERXLocalizedString that call the same method, you have a shortcut <wo:localized value="LOCALIZED_KEY" />

Thank you! I didn't realize that was a shortcut. Unfortunately, it does not display the language set in the system prefs either :-/

returns the proper string in the Japanese component.  Anyone ideas?

Thank you everyone!

On May 15, 2008, at 4:38 AM, Daniele Corti wrote:



2008/5/15 Rams <[EMAIL PROTECTED]>:
Thank you both for responding! It has taken me a while to get back to this.

Localizing strings seems to work fine. I have my English.lproj and Japanese.lproj folders in my Resources folder. I moved my Main.wo (ERXComponent) to my English.lproj folder, and when I attempt to create a Main.wo in my Japanese.lproj folder, WOLips complains about the duplicate. It seems to break WOLips and I get NullPointerExceptions making it impossible to edit either component until one or the other is deleted. Is there a naming convention I'm unaware of or some other magic that I am missing?

You can have any .wo file duplicate (one in each .lproj dir), but ony one .api file, check if there is only one Main.api, and put it in the Components directory (no sub dir).


Thanks again.

On Apr 13, 2008, at 7:59 AM, Cail Borrell wrote:

Hi TIA

In addition if you are not using sessions you can get your localizer with

       ERXLocalizer.defaultLocalizer()

and if you are using ERXComponent's you can call

       localizer()

directly from the component

Regards,
Cail


and if you are not using sessions
On 13/04/2008, at 10.35, Helmut Schottmüller wrote:

Hi TIA,

very simple and Apple Style as usual...
Just add the language resources you need in your Resources folder. I for example have a

German.lproj and
English.lproj

Inside these folders add your Localizable.strings file with the key- value-pairs for the localized strings (if you use Unicode encoding in your application, please make sure that the localized.strings files are UTF-16 encoded).

In the Application constructor you should set your default language using

 ERXLocalizer.setDefaultLanguage("German");

In the component bindings simply use

session.localizer.YOUR_LANGUAGE_ENTRY_KEY

in the code

session().localizer().valueForKey("YOUR_LANGUAGE_ENTRY_KEY")

If you need to offer localized components with a bit more than some localized language entries, you may create the components in the Resource/LANGUAGE.lproj directory for every language you use.

I am sure there is also an article in the Confluence Wiki about that (http://wiki.objectstyle.org).

Regards,
Helmut


Am 12.04.2008 um 21:14 schrieb Rams:
Hi all,

Can anyone point me in the direction of information regarding how to localize a WOLips project. The process was fairly straightforward in xcode, but I can't seem to find any info on WOLips. I would like to know how to localize components as well as strings.

TIA

--
Learn how to secure your email
(Mac OS X 10.3+) http://www.joar.com/certificates/
(Windows) http://www.marknoble.com/tutorial/smime/smime.aspx


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/helmut.schottmueller%40mac.com

This email sent to [EMAIL PROTECTED]

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/cail%40frontbase.com

This email sent to [EMAIL PROTECTED]

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/rgurley%40mac.com

This email sent to [EMAIL PROTECTED]


--
Learn how to secure your email
(Mac OS X 10.3+) http://www.joar.com/certificates/
(Windows) http://www.marknoble.com/tutorial/smime/smime.aspx



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/ildenae%40gmail.com

This email sent to [EMAIL PROTECTED]



--
Daniele Corti
AIM: S0CR4TE5
Messenger: [EMAIL PROTECTED]

--
Computers are like air conditioners -- they stop working properly if you open
WINDOWS

--
What about the four lusers of the apocalypse? I nominate:
"advertising", "can't log in", "power switch" and "what backup?"
--Alistair Young


--
Learn how to secure your email
(Mac OS X 10.3+) http://www.joar.com/certificates/
(Windows) http://www.marknoble.com/tutorial/smime/smime.aspx



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/ildenae%40gmail.com

This email sent to [EMAIL PROTECTED]



--
Daniele Corti
AIM: S0CR4TE5
Messenger: [EMAIL PROTECTED]

--
Computers are like air conditioners -- they stop working properly if you open
WINDOWS

--
What about the four lusers of the apocalypse? I nominate:
"advertising", "can't log in", "power switch" and "what backup?"
--Alistair Young


--
Learn how to secure your email
(Mac OS X 10.3+) http://www.joar.com/certificates/
(Windows) http://www.marknoble.com/tutorial/smime/smime.aspx


Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to