And how to change the error message for only "Error: Missing args"?
Thanks in advance, Xan
brianMon 12 Mar 2012
AbstractMain doesn't have any localization support today. As a general principle, nothing designed for "programmers" like APIs, docs, or command line tools are designed for localization in Fantom. Although everything designed for end-users like fwt::Command, etc are designed for localization.
XanTue 13 Mar 2012
A very very pain for me!. AbstractMain usage message is for users, at least in my case, because I will have users in catalan language with no knowledge of english.
1) Can I modify fantom internal code for achieve that?
2) Can you include it for next releases?
Thanks a lot,
KevinKelleyTue 13 Mar 2012
That should be a pretty easy one to fix. Grab the source of AbstractMain, change the uses of strings, to use a localized version:
msg := "$<missingArguments=Missing arguments>"
and define the value for your keys ( missingArguments=donde esta wtf ) in a locale/xx-XX.props file.
The Localization covers... it's about as simple as it could be, I guess.
brianTue 13 Mar 2012
Can I modify fantom internal code for achieve that?
I think the simplest thing is to just copy the code for AbstractMain or subclass and make your changes.
XanTue 13 Mar 2012
How can I make these changes in subclass of AbstractMain? Can you say the steps I have to follow?
Thanks,
brianWed 14 Mar 2012
Depending on how much you want to customize things you might just subclass AbstractMain and override usage to print usage using localized strings. If you really want to localize all the errors and whatnot, then I'd suggest just copying the entire source file and changing it to suite your purposes.
XanWed 14 Mar 2012
Mmm.. okay. I think override usage is my solution.
Xan Mon 12 Mar 2012
Hi,
I use AbstractMain . I use this example
I want to know how to localize the helping text, in my case:
And how to change the error message for only "Error: Missing args"?
Thanks in advance, Xan
brian Mon 12 Mar 2012
AbstractMain doesn't have any localization support today. As a general principle, nothing designed for "programmers" like APIs, docs, or command line tools are designed for localization in Fantom. Although everything designed for end-users like fwt::Command, etc are designed for localization.
Xan Tue 13 Mar 2012
A very very pain for me!. AbstractMain usage message is for users, at least in my case, because I will have users in catalan language with no knowledge of english.
1) Can I modify fantom internal code for achieve that?
2) Can you include it for next releases?
Thanks a lot,
KevinKelley Tue 13 Mar 2012
That should be a pretty easy one to fix. Grab the source of AbstractMain, change the uses of strings, to use a localized version:
and define the value for your keys (
missingArguments=donde esta wtf
) in alocale/xx-XX.props
file.The Localization covers... it's about as simple as it could be, I guess.
brian Tue 13 Mar 2012
I think the simplest thing is to just copy the code for AbstractMain or subclass and make your changes.
Xan Tue 13 Mar 2012
How can I make these changes in subclass of AbstractMain? Can you say the steps I have to follow?
Thanks,
brian Wed 14 Mar 2012
Depending on how much you want to customize things you might just subclass AbstractMain and override
usage
to print usage using localized strings. If you really want to localize all the errors and whatnot, then I'd suggest just copying the entire source file and changing it to suite your purposes.Xan Wed 14 Mar 2012
Mmm.. okay. I think override usage is my solution.
Thanks,