Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

help needed in Internationalisation in perl

by uva (Sexton)
on Feb 06, 2006 at 14:02 UTC ( [id://528241]=perlquestion: print w/replies, xml ) Need Help??

uva has asked for the wisdom of the Perl Monks concerning the following question:

i developed an application in perl which suit for the language "English" , now i want to modify the application which should accustom on all the language settings , depend up on the regional setting of the computer.. my question is that..... how to get the sytem's regional language setting(which is in controlpanel) in the perl language?
  • Comment on help needed in Internationalisation in perl

Replies are listed 'Best First'.
Re: help needed in Internationalisation in perl
by ikegami (Patriarch) on Feb 06, 2006 at 15:02 UTC
    There's a man page on the subject: perllocale

    Update: It seems localeconv is very limited in Windows, especially compared to accessing the registry directly. Looks like a bug to me.

    use POSIX qw( localeconv ); $lconv = localeconv(); printf "%20s : %s\n", $_, $lconv->{ $_ } for keys %{ $lconv }; __END__ mon_thousands_sep : , n_cs_precedes : 1 mon_grouping : ♥ negative_sign : - mon_decimal_point : . int_curr_symbol : USD decimal_point : . n_sign_posn : 0 p_sep_by_space : 0 currency_symbol : $ frac_digits : 2 int_frac_digits : 2 n_sep_by_space : 0 p_cs_precedes : 1 p_sign_posn : 3
Re: help needed in Internationalisation in perl
by BrowserUk (Patriarch) on Feb 06, 2006 at 15:31 UTC

    use Win32::TieRegistry ( TiedHash => '%reg', Delimiter => '/' ); my $int = $reg{ 'Users/.Default/Control Panel/International' }; printf "%20s : %s\n", $_, $int->{ $_ } for keys %{ $int }; Geo/ : Win32::TieRegistry=HASH(0x1a29d38) /iCountry : 44 /iCurrDigits : 2 /iCurrency : 0 /iDate : 1 /iDigits : 2 /iLZero : 1 /iMeasure : 0 /iNegCurr : 1 /iTime : 1 /iTLZero : 1 /Locale : 00000809 /s1159 : AM /s2359 : PM /sCountry : United Kingdom /sCurrency : ú /sDate : / /sDecimal : . /sLanguage : ENG /sList : , /sLongDate : dd MMMM yyyy /sShortDate : dd/MM/yyyy /sThousand : , /sTime : : /sTimeFormat : HH:mm:ss /iTimePrefix : 0 /sMonDecimalSep : . /sMonThousandSep : , /iNegNumber : 1 /sNativeDigits : 0123456789 /NumShape : 1 /iCalendarType : 1 /iFirstDayOfWeek : 0 /iFirstWeekOfYear : 0 /sGrouping : 3;0 /sMonGrouping : 3;0 /sPositiveSign : /sNegativeSign : -

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: help needed in Internationalisation in perl
by idle (Friar) on Feb 06, 2006 at 14:55 UTC
    As far as I know all the settings controlled via control panel, stored in registry. So you can easy read it with some adequate module. And don't forget that there is a lot of different systems, that have not control panel in it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://528241]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2025-02-18 06:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found