From 2baca29e58f0289a92fb081c92b984f4ebd6e73d Mon Sep 17 00:00:00 2001 From: Joshua Ferraro Date: Sat, 5 Jan 2008 03:44:53 -0500 Subject: [PATCH] WARNING: BIG I18N PATCH, you must import the subtag_registry.sql after this upgrade to benefit from the new features ... if you don't everything will work as before. bugfixing I18N language selection from staff and OPAC, adding BiDi support Signed-off-by: Joshua Ferraro --- C4/Output.pm | 5 +- .../mysql/en/mandatory/subtag_registry.sql | 624 ++++++++++++++++++ .../mysql/en/mandatory/subtag_registry.txt | 5 + .../fr/1-Obligatoire/subtag_registry.sql | 624 ++++++++++++++++++ .../fr/1-Obligatoire/subtag_registry.txt | 5 + installer/data/mysql/kohastructure.sql | 48 ++ installer/data/mysql/updatedatabase.pl | 62 ++ .../prog/en/modules/installer/step1.tmpl | 2 +- opac/opac-main.pl | 2 +- opac/opac-search.pl | 2 +- 10 files changed, 1374 insertions(+), 5 deletions(-) create mode 100644 installer/data/mysql/en/mandatory/subtag_registry.sql create mode 100644 installer/data/mysql/en/mandatory/subtag_registry.txt create mode 100644 installer/data/mysql/fr/1-Obligatoire/subtag_registry.sql create mode 100644 installer/data/mysql/fr/1-Obligatoire/subtag_registry.txt diff --git a/C4/Output.pm b/C4/Output.pm index c96573fe0c..0d57af5c2b 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -77,7 +77,7 @@ sub gettemplate { my $opacstylesheet = C4::Context->preference('opacstylesheet'); # if the template doesn't exist, load the English one as a last resort - my $filename = "$htdocs/$theme/$lang/".($interface eq 'intranet'?"modules":"")."/$tmplbase"; + my $filename = "$htdocs/$theme/$lang/modules/$tmplbase"; unless (-f $filename) { $lang = 'en'; $filename = "$htdocs/$theme/$lang/".($interface eq 'intranet'?"modules":"")."/$tmplbase"; @@ -141,7 +141,8 @@ sub themelanguage { # Set some defaults for language and theme # First, check the user's preferences my $lang; - $lang = accept_language($ENV{HTTP_ACCEPT_LANGUAGE},getTranslatedLanguages($interface,'prog')); + my $http_accept_language = regex_lang_subtags($ENV{HTTP_ACCEPT_LANGUAGE})->{language}; + $lang = accept_language($http_accept_language,getTranslatedLanguages($interface,'prog')); # But, if there's a cookie set, obey it $lang = $query->cookie('KohaOpacLanguage') if $query->cookie('KohaOpacLanguage'); diff --git a/installer/data/mysql/en/mandatory/subtag_registry.sql b/installer/data/mysql/en/mandatory/subtag_registry.sql new file mode 100644 index 0000000000..ae26b0a33b --- /dev/null +++ b/installer/data/mysql/en/mandatory/subtag_registry.sql @@ -0,0 +1,624 @@ +-- http://www.w3.org/International/articles/language-tags/ + +-- BIDI Stuff, Arabic and Hebrew +INSERT INTO language_script_bidi(rfc4646_subtag,bidi) +VALUES( 'Arab', 'rtl'); +INSERT INTO language_script_bidi(rfc4646_subtag,bidi) +VALUES( 'Hebr', 'rtl'); + +-- Default mappings between script and language subcodes +INSERT INTO language_script_mapping(language_subtag,script_subtag) +VALUES( 'ar', 'Arab'); +INSERT INTO language_script_mapping(language_subtag,script_subtag) +VALUES( 'he', 'Hebr'); + +-- EXTENSIONS +-- Interface (i) +-- SELECT * FROM language_subtag_registry WHERE type='i'; +-- OPAC +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'opac', 'i', 'OPAC','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'opac', 'i', 'en', 'OPAC'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'opac', 'i', 'fr', 'OPAC'); + +-- Staff Client +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'intranet', 'i', 'Staff Client','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'intranet', 'i', 'en', 'Staff Client'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'intranet', 'i', 'fr', '????'); + +-- Theme (t) +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'prog', 't', 'United Kingdom','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'prog', 'i', 'en', 'Prog'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'prog', 'i', 'fr', 'Prog'); + +-- LANGUAGES + +-- Arabic +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'ar', 'language', 'Arabic','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'ar','ara'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'ar', 'language', 'ar', 'العربية'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ar', 'language', 'en', 'Arabic'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ar', 'language', 'fr', 'Arabe'); + +-- Bulgarian +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'bg', 'language', 'Bulgarian','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'bg','bul'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'bg', 'language', 'bg', 'Български'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'bg', 'language', 'en', 'Bulgarian'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'bg', 'language', 'fr', 'Bulgare'); + +-- Chinese +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'zh', 'language', 'Chinese','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'zh','chi'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'zh', 'language', 'zh', '中文'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'zh', 'language', 'en', 'Chinese'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'zh', 'language', 'fr', 'Chinois'); + +-- Czech +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'cs', 'language', 'Czech','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'cs','cze'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'cs', 'language', 'cs', 'čeština'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'cs', 'language', 'en', 'Czech'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'cs', 'language', 'fr', 'Tchèque'); + +-- Danish +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'da', 'language', 'Danish','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'da','dan'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'da', 'language', 'da', 'Dænsk'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'da', 'language', 'en', 'Danish'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'da', 'language', 'fr', 'Danois'); + +-- Dutch, Flemish +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'nl', 'language', 'Dutch','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'nl','dut'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'nl', 'language', 'nl', 'nedərlɑns'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nl', 'language', 'en', 'Dutch'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nl', 'language', 'fr', 'Néerlandais'); + +-- English +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'en', 'language', 'English','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'en','en'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'en', 'language', 'en', 'English'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'en', 'language', 'fr', 'Anglais'); + +-- French +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'fr', 'language', 'French','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'fr','fr'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'fr', 'language', 'en', 'French'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'fr', 'language', 'fr', 'Français'); + +-- INSERT INTO language_descriptions(subtag, type, lang, description) +-- VALUES( 'fr-CA', 'language', 'fr-CA', 'français'); + +-- German +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'de', 'language', 'German','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'de','ger'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'de', 'language', 'de', 'Deutsch'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'de', 'language', 'en', 'German'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'de', 'language', 'fr', 'Allemand'); + +-- Greek +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'el', 'language', 'Greek, Modern [1453- ]','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'el','gre'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'el', 'language', 'el', 'ελληνικά'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'el', 'language', 'en', 'Greek, Modern [1453- ]'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'el', 'language', 'fr', 'Grec Moderne (Après 1453)'); + +-- Hebrew +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'he', 'language', 'Hebrew','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'he','heb'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'he', 'language', 'he', 'עברית'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'he', 'language', 'en', 'Hebrew'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'he', 'language', 'fr', 'Hébreu'); + +-- Hindi +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'hi', 'language', 'Hindi','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'hi','hin'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'hi', 'language', 'hi', 'हिन्दी'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'hi', 'language', 'en', 'Hindi'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'hi', 'language', 'fr', 'Hindi'); + +-- Hungarian +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'hu', 'language', 'Hungarian','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'hu','hun'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'hu', 'language', 'hu', 'Magyar'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'hu', 'language', 'en', 'Hungarian'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'hu', 'language', 'fr', 'Hongrois'); + +-- Indonesian +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'id', 'language', 'Indonesian','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'id','ind'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'id', 'language', 'id', 'Bahasa Indonesia'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'id', 'language', 'en', 'Indonesian'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'id', 'language', 'fr', 'Indonésien'); + +-- Italian +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'it', 'language', 'Italian','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'it','ind'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'it', 'language', 'it', 'Italiano'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'it', 'language', 'en', 'Italian'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'it', 'language', 'fr', 'Italien'); + +-- Japanese +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'ja', 'language', 'Japanese','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'ja','jpn'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ja', 'language', 'ja', '日本語'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ja', 'language', 'en', 'Japanese'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ja', 'language', 'fr', 'Japonais'); + +-- Korean +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'ko', 'language', 'Korean','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'ko','kor'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ko', 'language', 'ko', '한국어'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ko', 'language', 'en', 'Korean'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ko', 'language', 'fr', 'Coréen'); + +-- Latin +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'la', 'language', 'Latin','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'la','lat'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'la', 'language', 'la', 'Latina'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'la', 'language', 'en', 'Latin'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'la', 'language', 'fr', 'Latin'); + +-- Norwegian +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'nb', 'language', 'Norwegian','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'nb','nor'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'nb', 'Norsk'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'en', 'Norwegian'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'fr', 'Norvégien'); + +-- Persian +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'fa', 'language', 'Persian','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'fa','per'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'fa', 'language', 'fa', 'فارسى'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'fa', 'language', 'en', 'Persian'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'fa', 'language', 'fr', 'Persan'); + +-- Polish +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'pl', 'language', 'Polish','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'pl','pol'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'pl', 'language', 'pl', 'Polski'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'pl', 'language', 'en', 'Polish'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'pl', 'language', 'fr', 'Polonais'); + +-- Portuguese +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'pt', 'language', 'Portuguese','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'pt','pol'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'pt', 'language', 'pt', 'Português'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'pt', 'language', 'en', 'Portuguese'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'pt', 'language', 'fr', 'Portugais'); + +-- Romanian +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'ro', 'language', 'Romanian','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'ro','rum'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ro', 'language', 'ro', 'Română'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ro', 'language', 'en', 'Romanian'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ro', 'language', 'fr', 'Roumain'); + +-- Russian +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'ru', 'language', 'Russian','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'ru','rus'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ru', 'language', 'ru', 'Русский'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ru', 'language', 'en', 'Russian'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ru', 'language', 'fr', 'Russe'); + +-- Spanish, Castilian +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'es', 'language', 'Spanish','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'es','rus'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'es', 'language', 'es', 'Español'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'es', 'language', 'en', 'Spanish'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'es', 'language', 'fr', 'Espagnol'); + +-- Swedish +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'sv', 'language', 'Swedish','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'sv','swe'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'sv', 'language', 'sv', 'Svenska'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'sv', 'language', 'en', 'Swedish'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'sv', 'language', 'fr', 'Suédois'); + +-- Thai +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'th', 'language', 'Thai','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'th','tha'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'th', 'language', 'th', 'ภาษาไทย'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'th', 'language', 'en', 'Thai'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'th', 'language', 'fr', 'Thaï'); + +-- Turkish +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'tr', 'language', 'Turkish','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'tr','tur'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'tr', 'language', 'tr', 'Türkçe'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'tr', 'language', 'en', 'Turkish'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'tr', 'language', 'fr', 'Turc'); + + +-- Ukranian +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'uk', 'language', 'Ukranian','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'uk','ukr'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'uk', 'language', 'uk', 'Українська'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'uk', 'language', 'en', 'Ukranian'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'uk', 'language', 'fr', 'Ukrainien'); + + + +-- SCRIPTS +-- Arabic +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'Arab', 'script', 'Arabic','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'Arab','script', 'Arab', 'العربية'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'Arab', 'script','en', 'Arabic'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'Arab', 'script','fr', 'Arabic'); + +-- Cyrillic +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'Cyrl', 'script', 'Cyrillic','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'Cyrl', 'script', 'Cyrl', '????'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'Cyrl', 'script', 'en', 'Cyrillic'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'Cyrl', 'script', 'fr', 'Cyrillic'); + +-- Greek +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'Grek', 'script', 'Greek','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'Grek', 'script', 'Grek', '????'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'Grek', 'script', 'en', 'Greek'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'Grek', 'script', 'fr', 'Greek'); + +-- Han - Simplified +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'Hans', 'script', 'Han (Simplified variant)','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'Hans', 'script', 'Hans', 'Han (Simplified variant)'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'Hans', 'script', 'en', 'Han (Simplified variant)'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'Hans', 'script', 'fr', 'Han (Simplified variant)'); + +-- Han - Traditional +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'Hant', 'script', 'Han (Traditional variant)','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'Hant', 'script', 'Hant', 'Han (Traditional variant)'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'Hant', 'script', 'en', 'Han (Traditional variant)'); + +-- Hebrew +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'Hebr', 'script', 'Hebrew','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'Hebr', 'script', 'Hebr', 'Hebrew'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'Hebr', 'script', 'en', 'Hebrew'); + +-- REGIONS +-- Canada +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'CA', 'region', 'Canada','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'CA', 'region', 'en', 'Canada'); + +-- France +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'FR', 'region', 'France','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'FR', 'region', 'fr', 'France'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'FR', 'region', 'en', 'France'); + +-- New Zealand +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'NZ', 'region', 'New Zealand','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'NZ', 'region', 'en', 'New Zealand'); + +-- United Kingdom +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'GB', 'region', 'United Kingdom','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'GB', 'region', 'en', 'United Kingdom'); + +-- United States +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'US', 'region', 'United States','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'US', 'region', 'en', 'United States'); diff --git a/installer/data/mysql/en/mandatory/subtag_registry.txt b/installer/data/mysql/en/mandatory/subtag_registry.txt new file mode 100644 index 0000000000..5648982480 --- /dev/null +++ b/installer/data/mysql/en/mandatory/subtag_registry.txt @@ -0,0 +1,5 @@ +Koha I18N Support + +BIDI Stuff, Arabic and Hebrew +Default mappings between script and language subcodes +Language Extensions diff --git a/installer/data/mysql/fr/1-Obligatoire/subtag_registry.sql b/installer/data/mysql/fr/1-Obligatoire/subtag_registry.sql new file mode 100644 index 0000000000..ae26b0a33b --- /dev/null +++ b/installer/data/mysql/fr/1-Obligatoire/subtag_registry.sql @@ -0,0 +1,624 @@ +-- http://www.w3.org/International/articles/language-tags/ + +-- BIDI Stuff, Arabic and Hebrew +INSERT INTO language_script_bidi(rfc4646_subtag,bidi) +VALUES( 'Arab', 'rtl'); +INSERT INTO language_script_bidi(rfc4646_subtag,bidi) +VALUES( 'Hebr', 'rtl'); + +-- Default mappings between script and language subcodes +INSERT INTO language_script_mapping(language_subtag,script_subtag) +VALUES( 'ar', 'Arab'); +INSERT INTO language_script_mapping(language_subtag,script_subtag) +VALUES( 'he', 'Hebr'); + +-- EXTENSIONS +-- Interface (i) +-- SELECT * FROM language_subtag_registry WHERE type='i'; +-- OPAC +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'opac', 'i', 'OPAC','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'opac', 'i', 'en', 'OPAC'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'opac', 'i', 'fr', 'OPAC'); + +-- Staff Client +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'intranet', 'i', 'Staff Client','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'intranet', 'i', 'en', 'Staff Client'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'intranet', 'i', 'fr', '????'); + +-- Theme (t) +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'prog', 't', 'United Kingdom','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'prog', 'i', 'en', 'Prog'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'prog', 'i', 'fr', 'Prog'); + +-- LANGUAGES + +-- Arabic +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'ar', 'language', 'Arabic','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'ar','ara'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'ar', 'language', 'ar', 'العربية'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ar', 'language', 'en', 'Arabic'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ar', 'language', 'fr', 'Arabe'); + +-- Bulgarian +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'bg', 'language', 'Bulgarian','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'bg','bul'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'bg', 'language', 'bg', 'Български'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'bg', 'language', 'en', 'Bulgarian'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'bg', 'language', 'fr', 'Bulgare'); + +-- Chinese +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'zh', 'language', 'Chinese','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'zh','chi'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'zh', 'language', 'zh', '中文'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'zh', 'language', 'en', 'Chinese'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'zh', 'language', 'fr', 'Chinois'); + +-- Czech +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'cs', 'language', 'Czech','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'cs','cze'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'cs', 'language', 'cs', 'čeština'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'cs', 'language', 'en', 'Czech'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'cs', 'language', 'fr', 'Tchèque'); + +-- Danish +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'da', 'language', 'Danish','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'da','dan'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'da', 'language', 'da', 'Dænsk'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'da', 'language', 'en', 'Danish'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'da', 'language', 'fr', 'Danois'); + +-- Dutch, Flemish +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'nl', 'language', 'Dutch','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'nl','dut'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'nl', 'language', 'nl', 'nedərlɑns'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nl', 'language', 'en', 'Dutch'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nl', 'language', 'fr', 'Néerlandais'); + +-- English +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'en', 'language', 'English','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'en','en'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'en', 'language', 'en', 'English'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'en', 'language', 'fr', 'Anglais'); + +-- French +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'fr', 'language', 'French','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'fr','fr'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'fr', 'language', 'en', 'French'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'fr', 'language', 'fr', 'Français'); + +-- INSERT INTO language_descriptions(subtag, type, lang, description) +-- VALUES( 'fr-CA', 'language', 'fr-CA', 'français'); + +-- German +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'de', 'language', 'German','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'de','ger'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'de', 'language', 'de', 'Deutsch'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'de', 'language', 'en', 'German'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'de', 'language', 'fr', 'Allemand'); + +-- Greek +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'el', 'language', 'Greek, Modern [1453- ]','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'el','gre'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'el', 'language', 'el', 'ελληνικά'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'el', 'language', 'en', 'Greek, Modern [1453- ]'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'el', 'language', 'fr', 'Grec Moderne (Après 1453)'); + +-- Hebrew +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'he', 'language', 'Hebrew','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'he','heb'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'he', 'language', 'he', 'עברית'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'he', 'language', 'en', 'Hebrew'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'he', 'language', 'fr', 'Hébreu'); + +-- Hindi +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'hi', 'language', 'Hindi','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'hi','hin'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'hi', 'language', 'hi', 'हिन्दी'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'hi', 'language', 'en', 'Hindi'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'hi', 'language', 'fr', 'Hindi'); + +-- Hungarian +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'hu', 'language', 'Hungarian','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'hu','hun'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'hu', 'language', 'hu', 'Magyar'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'hu', 'language', 'en', 'Hungarian'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'hu', 'language', 'fr', 'Hongrois'); + +-- Indonesian +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'id', 'language', 'Indonesian','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'id','ind'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'id', 'language', 'id', 'Bahasa Indonesia'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'id', 'language', 'en', 'Indonesian'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'id', 'language', 'fr', 'Indonésien'); + +-- Italian +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'it', 'language', 'Italian','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'it','ind'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'it', 'language', 'it', 'Italiano'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'it', 'language', 'en', 'Italian'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'it', 'language', 'fr', 'Italien'); + +-- Japanese +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'ja', 'language', 'Japanese','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'ja','jpn'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ja', 'language', 'ja', '日本語'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ja', 'language', 'en', 'Japanese'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ja', 'language', 'fr', 'Japonais'); + +-- Korean +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'ko', 'language', 'Korean','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'ko','kor'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ko', 'language', 'ko', '한국어'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ko', 'language', 'en', 'Korean'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ko', 'language', 'fr', 'Coréen'); + +-- Latin +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'la', 'language', 'Latin','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'la','lat'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'la', 'language', 'la', 'Latina'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'la', 'language', 'en', 'Latin'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'la', 'language', 'fr', 'Latin'); + +-- Norwegian +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'nb', 'language', 'Norwegian','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'nb','nor'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'nb', 'Norsk'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'en', 'Norwegian'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'fr', 'Norvégien'); + +-- Persian +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'fa', 'language', 'Persian','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'fa','per'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'fa', 'language', 'fa', 'فارسى'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'fa', 'language', 'en', 'Persian'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'fa', 'language', 'fr', 'Persan'); + +-- Polish +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'pl', 'language', 'Polish','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'pl','pol'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'pl', 'language', 'pl', 'Polski'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'pl', 'language', 'en', 'Polish'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'pl', 'language', 'fr', 'Polonais'); + +-- Portuguese +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'pt', 'language', 'Portuguese','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'pt','pol'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'pt', 'language', 'pt', 'Português'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'pt', 'language', 'en', 'Portuguese'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'pt', 'language', 'fr', 'Portugais'); + +-- Romanian +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'ro', 'language', 'Romanian','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'ro','rum'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ro', 'language', 'ro', 'Română'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ro', 'language', 'en', 'Romanian'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ro', 'language', 'fr', 'Roumain'); + +-- Russian +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'ru', 'language', 'Russian','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'ru','rus'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ru', 'language', 'ru', 'Русский'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ru', 'language', 'en', 'Russian'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'ru', 'language', 'fr', 'Russe'); + +-- Spanish, Castilian +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'es', 'language', 'Spanish','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'es','rus'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'es', 'language', 'es', 'Español'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'es', 'language', 'en', 'Spanish'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'es', 'language', 'fr', 'Espagnol'); + +-- Swedish +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'sv', 'language', 'Swedish','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'sv','swe'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'sv', 'language', 'sv', 'Svenska'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'sv', 'language', 'en', 'Swedish'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'sv', 'language', 'fr', 'Suédois'); + +-- Thai +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'th', 'language', 'Thai','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'th','tha'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'th', 'language', 'th', 'ภาษาไทย'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'th', 'language', 'en', 'Thai'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'th', 'language', 'fr', 'Thaï'); + +-- Turkish +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'tr', 'language', 'Turkish','2005-10-16' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'tr','tur'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'tr', 'language', 'tr', 'Türkçe'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'tr', 'language', 'en', 'Turkish'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'tr', 'language', 'fr', 'Turc'); + + +-- Ukranian +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'uk', 'language', 'Ukranian','2005-10-16'); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'uk','ukr'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'uk', 'language', 'uk', 'Українська'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'uk', 'language', 'en', 'Ukranian'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'uk', 'language', 'fr', 'Ukrainien'); + + + +-- SCRIPTS +-- Arabic +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'Arab', 'script', 'Arabic','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'Arab','script', 'Arab', 'العربية'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'Arab', 'script','en', 'Arabic'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'Arab', 'script','fr', 'Arabic'); + +-- Cyrillic +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'Cyrl', 'script', 'Cyrillic','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'Cyrl', 'script', 'Cyrl', '????'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'Cyrl', 'script', 'en', 'Cyrillic'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'Cyrl', 'script', 'fr', 'Cyrillic'); + +-- Greek +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'Grek', 'script', 'Greek','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'Grek', 'script', 'Grek', '????'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'Grek', 'script', 'en', 'Greek'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'Grek', 'script', 'fr', 'Greek'); + +-- Han - Simplified +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'Hans', 'script', 'Han (Simplified variant)','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'Hans', 'script', 'Hans', 'Han (Simplified variant)'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'Hans', 'script', 'en', 'Han (Simplified variant)'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'Hans', 'script', 'fr', 'Han (Simplified variant)'); + +-- Han - Traditional +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'Hant', 'script', 'Han (Traditional variant)','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'Hant', 'script', 'Hant', 'Han (Traditional variant)'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'Hant', 'script', 'en', 'Han (Traditional variant)'); + +-- Hebrew +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'Hebr', 'script', 'Hebrew','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'Hebr', 'script', 'Hebr', 'Hebrew'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'Hebr', 'script', 'en', 'Hebrew'); + +-- REGIONS +-- Canada +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'CA', 'region', 'Canada','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'CA', 'region', 'en', 'Canada'); + +-- France +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'FR', 'region', 'France','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES ( 'FR', 'region', 'fr', 'France'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'FR', 'region', 'en', 'France'); + +-- New Zealand +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'NZ', 'region', 'New Zealand','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'NZ', 'region', 'en', 'New Zealand'); + +-- United Kingdom +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'GB', 'region', 'United Kingdom','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'GB', 'region', 'en', 'United Kingdom'); + +-- United States +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'US', 'region', 'United States','2005-10-16'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'US', 'region', 'en', 'United States'); diff --git a/installer/data/mysql/fr/1-Obligatoire/subtag_registry.txt b/installer/data/mysql/fr/1-Obligatoire/subtag_registry.txt new file mode 100644 index 0000000000..5648982480 --- /dev/null +++ b/installer/data/mysql/fr/1-Obligatoire/subtag_registry.txt @@ -0,0 +1,5 @@ +Koha I18N Support + +BIDI Stuff, Arabic and Hebrew +Default mappings between script and language subcodes +Language Extensions diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 843fe8598e..937df9b5c5 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1836,6 +1836,54 @@ CREATE TABLE `services_throttle` ( PRIMARY KEY (`service_type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- http://www.w3.org/International/articles/language-tags/ + +-- RFC4646 +DROP TABLE IF EXISTS language_subtag_registry; +CREATE TABLE language_subtag_registry ( + subtag varchar(25), + type varchar(25), -- language-script-region-variant-extension-privateuse + description varchar(25), -- only one of the possible descriptions for ease of reference, see language_descriptions for the complete list + added date, + KEY `subtag` (`subtag`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- TODO: add suppress_scripts +-- this maps three letter codes defined in iso639.2 back to their +-- two letter equivilents in rfc4646 (LOC maintains iso639+) +DROP TABLE IF EXISTS language_rfc4646_to_iso639; +CREATE TABLE language_rfc4646_to_iso639 ( + rfc4646_subtag varchar(25), + iso639_2_code varchar(25), + KEY `rfc4646_subtag` (`rfc4646_subtag`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS language_descriptions; +CREATE TABLE language_descriptions ( + subtag varchar(25), + type varchar(25), + lang varchar(25), + description varchar(255), + KEY `lang` (`lang`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- bi-directional support, keyed by script subcode +DROP TABLE IF EXISTS language_script_bidi; +CREATE TABLE language_script_bidi ( + rfc4646_subtag varchar(25), -- script subtag, Arab, Hebr, etc. + bidi varchar(3), -- rtl ltr + KEY `rfc4646_subtag` (`rfc4646_subtag`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- TODO: need to map language subtags to script subtags for detection +-- of bidi when script is not specified (like ar, he) +DROP TABLE IF EXISTS language_script_mapping; +CREATE TABLE language_script_mapping ( + language_subtag varchar(25), + script_subtag varchar(25), + KEY `language_subtag` (`language_subtag`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index d0f47342f1..eb45afb289 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -868,6 +868,68 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +#-- http://www.w3.org/International/articles/language-tags/ + +#-- RFC4646 +$DBversion = "3.00.00.045"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do(" +CREATE TABLE language_subtag_registry ( + subtag varchar(25), + type varchar(25), -- language-script-region-variant-extension-privateuse + description varchar(25), -- only one of the possible descriptions for ease of reference, see language_descriptions for the complete list + added date, + KEY `subtag` (`subtag`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8"); + +#-- TODO: add suppress_scripts +#-- this maps three letter codes defined in iso639.2 back to their +#-- two letter equivilents in rfc4646 (LOC maintains iso639+) + $dbh->do("CREATE TABLE language_rfc4646_to_iso639 ( + rfc4646_subtag varchar(25), + iso639_2_code varchar(25), + KEY `rfc4646_subtag` (`rfc4646_subtag`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8"); + + $dbh->do("CREATE TABLE language_descriptions ( + subtag varchar(25), + type varchar(25), + lang varchar(25), + description varchar(255), + KEY `lang` (`lang`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8"); + +#-- bi-directional support, keyed by script subcode + $dbh->do("CREATE TABLE language_script_bidi ( + rfc4646_subtag varchar(25), -- script subtag, Arab, Hebr, etc. + bidi varchar(3), -- rtl ltr + KEY `rfc4646_subtag` (`rfc4646_subtag`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8"); + +#-- BIDI Stuff, Arabic and Hebrew + $dbh->do("INSERT INTO language_script_bidi(rfc4646_subtag,bidi) +VALUES( 'Arab', 'rtl'"); + $dbh->do("INSERT INTO language_script_bidi(rfc4646_subtag,bidi) +VALUES( 'Hebr', 'rtl')"); + +#-- TODO: need to map language subtags to script subtags for detection +#-- of bidi when script is not specified (like ar, he) + $dbh->do("CREATE TABLE language_script_mapping ( + language_subtag varchar(25), + script_subtag varchar(25), + KEY `language_subtag` (`language_subtag`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8"); + +#-- Default mappings between script and language subcodes + $dbh->do("INSERT INTO language_script_mapping(language_subtag,script_subtag) +VALUES( 'ar', 'Arab')"); + $dbh->do("INSERT INTO language_script_mapping(language_subtag,script_subtag) +VALUES( 'he', 'Hebr')"); + + print "Upgrade to $DBversion done (adding language subtag registry and basic BiDi support NOTE: You should import the subtag registry SQL)\n"; + SetVersion ($DBversion); +} + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tmpl index 6189788118..f368b8bd62 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tmpl @@ -11,7 +11,7 @@ listed, please inform your systems administrator.

diff --git a/opac/opac-main.pl b/opac/opac-main.pl index 5875baa1d3..a7b5f24bb2 100755 --- a/opac/opac-main.pl +++ b/opac/opac-main.pl @@ -22,7 +22,7 @@ use CGI; use C4::Auth; # get_template_and_user use C4::Output; use C4::VirtualShelves; -use C4::Languages; # getTranslatedLanguages +use C4::Languages qw/getTranslatedLanguages/; use C4::Branch; # GetBranches use C4::Members; # GetMember use C4::NewsChannels; # get_opac_news diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 43dcd7d421..26b121d28c 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -164,7 +164,7 @@ use C4::Context; use C4::Output; use C4::Auth; use C4::Search; -use C4::Languages; # getAllLanguages +use C4::Languages qw/getTranslatedLanguages getAllLanguages/; use C4::Koha; use POSIX qw(ceil floor); use C4::Branch; # GetBranches -- 2.39.5