- # fill in the ISO6329 code
- $language_subtag_registry->{iso639_2_code} = $language_descriptions->{iso639_2_code};
- $language_subtag_registry->{language_description} = $language_descriptions->{description};
+ $sth3->execute($language_subtag_registry->{subtag},$language_subtag_registry->{subtag});
+ my $native_description;
+ while (my $description = $sth3->fetchrow_hashref) {
+ $native_description = $description->{description};
+ }
+
+ # fill in the ISO6329 code
+ $language_subtag_registry->{iso639_2_code} = $language_descriptions->{iso639_2_code};
+ # fill in the native description of the language, as well as the current language's translation of that if it exists
+ if ($native_description) {
+ $language_subtag_registry->{language_description} = $native_description;
+ $language_subtag_registry->{language_description}.=" ($language_descriptions->{description})" if $language_descriptions->{description};
+ }
+ else {
+ $language_subtag_registry->{language_description} = $language_descriptions->{description};
+ }