Hi Martin thanks a lot it is not too much work we don´t have too many entries for now, the current language files are bundled in
.. /core/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n
You will get the idea on how to enable everything as soon as you have a look at the code, but however: the i18n is implemented as a javascript class which overrides the default english settings (that way i have an easy fallback in case of a missing key). Here is the example for german

myfaces._impl.core._Runtime.extendClass("myfaces._impl.i18n.Messages_de", myfaces._impl.i18n.Messages, {
    //_Lang.js
    ERR_MUST_STRING:        "{0}: {1} namespace muss vom Typ String sein",
ERR_REF_OR_ID: "{0}: {1} Ein Referenzknoten oder id muss übergeben werden",
    ERR_PARAM_GENERIC:      "{0}: Paramter {1} muss vom Typ {2} sein",
    ERR_PARAM_STR:          "{0}: Parameter {1} muss vom Typ String sein"
});


So the entries simply are a javascript map and the inheritance is used for easy fallback. Simple but effective.

For the naming you can use the standard iso codes for language and variants:
For instance

myfaces._impl.i18n.Messages_de for standard german
and
myfaces._impl.i18n.Messages_de_AT for german austrian variant.
The javascript system tries to detect the correct language and then picks up the correctly registered class for the language and variant. But for the variant derive the class from the core language file and override only the entries you want to set new

so it makes sense to derive myfaces._impl.i18n.Messages_de from english for uncovered key entries and then myfaces._impl.i18n.Messages_de_AT from the core german myfaces._impl.i18n.Messages_de

Sounds more complicated than in reality it is.

Feel free to ask questions if you have them.


Werner




Am 11.01.11 20:27, schrieb Martin Koci:
Hi,

I will do it for Czech and Slovak: MYFACES-3014. Not very frequent
languages, though - but 10 491 492 (CZ) + approx 5 mil (SK) inhabitants
(samt Kindern und Rentnern) of Czech + Slovak Republic will appreciate
it :)


Werner Punz píše v Út 11. 01. 2011 v 15:13 +0100:
Btw. I did some work in this area for the client. We now have localized
ajax error messages, for now only english and german, anyone willing to
step in for other languages?

Werner


Am 11.01.11 14:00, schrieb Martin Marinschek:
I am always for better error reporting!

best regards,

Martin

On 1/10/11, Jakob Korherr<jakob.korh...@gmail.com>   wrote:
Hi Kocicak,

++++1

Regards,
Jakob

2011/1/10 Martin Koci<martin.kocicak.k...@gmail.com>:

Hi,

the most wanted feature which our coders want is more consistent and
human-readable error reporting and logging. Here is a example:

If user specifies f:ajax without eventName for a component without
defaultEventName, myfaces throw a execption:

Now (myfaces 2.0.3):
eventName could not be defined for f:ajax tag with no wrap mode.



Improved (example only; from my copy of myfaces):

MF0345: Your ajax tag does not specify eventName and component
com.foo.Bazz does not provide the default one. Please use one from
available: [change, blur, focus ...]";

Tag location: XYZ.xhtml line 56 column 23,<f:ajax  ..... />

Component: id: componentId,  class: com.foo.BazzInput, component type:
org.renderkit.Input

ViewId: YYZ.xhml, located in file system
as: /tmp/deploy/weabpp/XYZ.xhtml

PhaseId: RENDER_RESPONSE

Details: ... a detailed description of this problem + suggestions,
example of code.

References:
#  Click for problem MF0345 in MYFACES knowledge database (hypertext
link)
# Contact your technology team : m...@to.me
# If you think this a bug report it: jira.project.org






What do you think about this idea?

(I'll describe our requirements and what I found so far in next emails)


Regards,

Kočičák





--
Jakob Korherr

blog: http://www.jakobk.com
twitter: http://twitter.com/jakobkorherr
work: http://www.irian.at











Reply via email to