so French.pm might look like:Would you please clean up your code, this is jibberish. You have a lexical hash, which is not accessible outside of this module file; a block of which I assume it is supposed to represent an anonymous hash AKA a hash ref, your strings on the RHS of the arrows are unquoted, you separate the key/value pairs with semicolons instead of comma's, and you have a "1;" inside the hash definition instead of after it. Plus there is no "=" sign connecting the hash and the data. Well, at least your comment uses the correct delimiter. ;-)package MyWebsite::French; my %translation { tag_color => rouge; tag_street => rue; tag_hooligan => anglais; #etc 1; }
Cleaned up:
Now, one can have access to this hash via %MyWebsite::French::translation.package MyWebsite::French; %translation = ( tag_color => 'rouge', tag_street => 'rue', tag_hooligan => 'anglais', #etc ); 1;
Otherwise, your suggestion to use a template module sounds good to me.
In reply to Re: Another way of doing foreign language support
by bart
in thread Do I need an array within an array
by meetn2veg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |