Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of ambs (3914)

Thursday July 05, 2007
03:10 PM

Lingua::Flags new module.

[ #33703 ]

So, a new module named Lingua::Flags is available on CPAN. I wanted to write this module for about an year, but other things got in the middle.

A lot of Lingua:: modules have web interfaces, and a lot of them can benefit from flags to identify languages. Thus, I created this little bundle with 238 flags. You can access them using a function that return a GIF, or using another one, that returns a base64 encoded image to use with the HTML img tag. Unfortunately this kind of inline images do not work under Internet Explorer.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Fascinating. A few requests:
    1. Please include in your POD an attribution of the source of the images. Did you make them yourself? Are they indeed Artistic/GPL licensed?
    2. Add a convenience method to dump them to disk.
    3. Include in your documentation the origin of the country abbreviations. Are those ISO/RFC-standardized abbreviations?
    4. Include in the POD you plan for updates if/when flags or abbreviations change.
    5. Consider finding a co-maintainer for this module because someday you may not want or be able to maint
  • Sorry I didn't see this fly by... since I have to rain on your parade and point out that binding a language (Lingua) to a flag is a completely misguided idea. Sorry. Here is a good writeup on the matter: []
    • Please read the answer in the other post bellow. That document explains why the flag is bad to choose a language, not to represent the language in which a text is written.
      • I disagree (and I worked with the guy who wrote the document, so I know he disagrees too :-) Flag is AN EXTREMELY BAD ICON for a language, and therefore transitively for the language of a text. Besides, I was present when the Lingua:: was designed - it was meant to be for language-specific localizations. Flags aren't. Go with Locale::Flags and things are fine.
      • For the record, about once a month (sometimes once a week), I get completely confused on a website somewhere that wants me to click the flag of Great Britain in order to see the website in English. I mean I stop and sit there staring at it slack-jawed for a couple of minutes trying to figure out what the heck I am supposed to do. Of course, it doesn't help that I'm a self-centered American, anyway, and want to just go to the website and get it in English, and-if-I-want-it-in-some-other-language-I'll-ask-f

        J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
        • And then there are people who might want you to use Ulster Scots (all of whom are mad, of course) and can't tell whether the teeny tiny icon is that of the English flag or the Northern Ireland flag. Or those who can't figure out whether your icon is the flag of Italy or Ireland because their monitor doesn't have quite the same settings as yours.

          So not only is using flags a bad idea for representing a language, using *small* flags without a visible textual equivalent (and no, ALT text isn't good enough co

  • I think you've created a useful module, but it should really be called Country::Flags. I don't understand why web sites use flags to select a language. Flags represent countries, not languages.

    For example, on the easyJet [] site, if I'm a Swiss resident who speaks Italian, is it right to click the Italian flag? And what about Portuguese? If I'm in Brazil and speak Brazilian Portuguese, do I have to click the Portuguese flag? How do you distinguish between simplified Chinese [] and traditional Chinese []? Do you at

    • Hi I understand and agree to some point with your post. Now, let me explain:
      • I know flags are for countries, not for languages;
      • I know there are languages with flags that do not have countries (see Esperanto flag at []);
      • In my case I do not want to put links on web-pages, although I use flags for that as well :)
      • I want to have PT and BR as two different flags. They are different languages, and thus, I want to differentiate them.
      • Regarding Chinese, I do not have enough kno
      • Flags::Thumbnails

        J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
    • Locale::Flags.
    • The most obvious (counter)example probably of course being: what flag to choose for English? U.S.? U.K.? England? Scotland? Wales? Ireland? Canada? Australia? NZ? The Commonwealth?
      • There is no "ENGLISH" language. Sorry if you disagree, but if you are planning to use English corpora for machine translation you will NOT join corpora from those different sources. You will end up with a confused dictionary.
        • Sorry, I have no idea what the heck you are talking about. Why did you suddenly switch to ENGLISH (all uppercase) in the discussion? Why are you talking about corpora and machine translation? We were talking about flags as symbols of languages, I thought...