Locale::Language(3)

πŸ’– Locale::Language(3) πŸ’–

okay so real talk β€” this is the Locale::Language(3) page, from the User Contributed Perl Documentation corner of the universe, and it's basically your cheat sheet for language code sets. welcome, bestie, let's get into it ✨


🌸 NAME 🌸

Locale::Language β€” the module for dealing with language code sets. that's it, that's the vibe πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

use Locale::Language;

$name = code2language(CODE);
$code = language2code(NAME);

@codes   = all_language_codes();
@names   = all_language_names();

like, you give it a code and it gives you a name, you give it a name and it gives you a code. iconic symmetry, no cap πŸ’…


✨ DESCRIPTION ✨

so this module gives you access to language code sets. that's the whole gig 🫢

for the deets on which code sets are actually available, go read the Locale::Codes::Types document β€” it's the lore drop, iykyk.

most of the routines take an optional extra argument that says which code set to use. you can pass that either as the name of a code set, or as the perl constant from that document above. if you don't bother specifying one, the default code set gets used. easy πŸ’–


πŸ”₯ ROUTINES πŸ”₯

every routine in this module calls the matching method over in the Locale::Codes module, using an object of type: language. if you want the deep dive on what each function actually does, go read the Locale::Codes docs β€” she's the main character, this module is the spin-off 🌟

πŸ’œ the ones that get exported automatically πŸ’œ

  • code2language(CODE [,CODESET] [,'retired']) β€” see code2name in Locale::Codes
  • code2languages(CODE [,CODESET]) β€” see code2names in Locale::Codes
  • language2code(NAME [,CODESET] [,'retired']) β€” see name2code in Locale::Codes
  • language_code2code(CODE ,CODESET ,CODESET2) β€” see code2code in Locale::Codes
  • all_language_codes([CODESET] [,'retired']) β€” see all_codes in Locale::Codes
  • all_language_names([CODESET] [,'retired']) β€” see all_names in Locale::Codes

🧚 the ones that are NOT exported 🧚

these ones are lowkey shy β€” you have to call them fully qualified with the package name, no shortcuts πŸ™ˆ

  • Locale::Language::show_errors(FLAG) β€” by default, invalid input just gives you empty results, no errors, no drama. but if you pass in a non-zero value of FLAG, errors will actually be produced. see show_errors in Locale::Codes β€” but heads up, the default for the non-OO modules is to NOT produce errors πŸ’€
  • Locale::Language::rename_language(CODE ,NEW_NAME [,CODESET]) β€” see rename_code in Locale::Codes
  • Locale::Language::add_language(CODE ,NAME [,CODESET]) β€” see add_code in Locale::Codes
  • Locale::Language::delete_language(CODE [,CODESET]) β€” see delete_code in Locale::Codes
  • Locale::Language::add_language_alias(NAME ,NEW_NAME) β€” see add_alias in Locale::Codes
  • Locale::Language::delete_language_alias(NAME) β€” see delete_alias in Locale::Codes
  • Locale::Language::rename_language_code(CODE ,NEW_CODE [,CODESET]) β€” see replace_code in Locale::Codes
  • Locale::Language::add_language_code_alias(CODE ,NEW_CODE [,CODESET]) β€” see add_code_alias in Locale::Codes
  • Locale::Language::delete_language_code_alias(CODE [,CODESET]) β€” see delete_code_alias in Locale::Codes

🌈 SEE ALSO 🌈

  • Locale::Codes β€” the Locale-Codes distribution, aka the whole fam 🏠

πŸ‘‘ AUTHOR πŸ‘‘

for the full author history, see Locale::Codes β€” the archives, bestie πŸ“œ

currently maintained by Sullivan Beck (sbeck@cpan.org). thank you for your service 🫑


Copyright (c) 2011-2024 Sullivan Beck

this module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. slay, legally speaking βš–οΈβœ¨


ngl that's the whole page. go forth and localize, bestie πŸ’…

perl v5.42.0 Β· 2024-06-23 Β· that's the version and date, mwah, signing off β€” Locale::Language(3) πŸ¦‹πŸ’–πŸŒΈ

πŸ“¦ where this page comes from