Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Used nv-i18n library to add better support for iso639-2/T iso639-2/B support #5982

Conversation

ianwallen
Copy link
Contributor

I had noticed that there were a few cases where languages were being converted from iso639-2/T iso639-2/B but there were not handling all languages. Applied a new consistent converted using the nv-i18n library.

@matself
Copy link
Contributor

matself commented Oct 4, 2021

Will this solve the problem with the missing INSPIRE browse brick titles that contain Swedish characters?

@ianwallen
Copy link
Contributor Author

@matself
I don't believe this will fix that problem as this fix is mostly to standardize the iso639-2/T iso639-2/B support. I see that Sweden is swe for both T and B so it should not be affected.

This is mostly to standardize on the languages that do have different codes between T/B - i.e. fre/fra, slo/slk, der/deu...

@matself
Copy link
Contributor

matself commented Oct 5, 2021 via email

Log.error(Geonet.GEONETWORK, "Failed to get iso 2 language code for " + iso3LangCode + " caused by " + ex.getMessage());
LanguageCode languageCode = LanguageCode.getByCode(iso3LangCode.toLowerCase());
if (languageCode != null) {
iso2LangCode = languageCode.name();
Copy link
Member

@josegar74 josegar74 Oct 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the previous code iso2LangCode had the language 2 iso code. To confirm that this is what is returned by languageCode.name()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

…_2B should have been used.

Updated language parsing to support fr:can
@josegar74 josegar74 merged commit 32d9d6d into geonetwork:main Oct 20, 2021
@ianwallen
Copy link
Contributor Author

@josegar74
I would like to have this back ported to 3.12.x. There are lots of conflicts when doing the backport. So I will submit a separate PR for the backport of this PR.

ianwallen added a commit to ianwallen/core-geonetwork that referenced this pull request Oct 20, 2021
Used nv-i18n library to add better support for iso639-2/T iso639-2/B support (geonetwork#5982)

* Used nv-i18n library to add better support for iso639-2/T iso639-2/B support

* Fixed bug where getAlpha3T and isoLanguagesMapper.iso639_2T_to_iso639_2B should have been used.
Updated language parsing to support fr:can
# Conflicts:
#	core/src/main/java/org/fao/geonet/util/XslUtil.java
#	pom.xml
#	services/src/main/java/org/fao/geonet/api/records/CatalogApi.java
#	services/src/main/java/org/fao/geonet/api/records/formatters/FormatterApi.java
#	services/src/main/java/org/fao/geonet/api/tools/i18n/LanguageUtils.java
#	services/src/main/java/org/fao/geonet/api/tools/i18n/TranslationApi.java
josegar74 pushed a commit that referenced this pull request Oct 22, 2021
Used nv-i18n library to add better support for iso639-2/T iso639-2/B support (#5982)

* Used nv-i18n library to add better support for iso639-2/T iso639-2/B support

* Fixed bug where getAlpha3T and isoLanguagesMapper.iso639_2T_to_iso639_2B should have been used.
Updated language parsing to support fr:can
# Conflicts:
#	core/src/main/java/org/fao/geonet/util/XslUtil.java
#	pom.xml
#	services/src/main/java/org/fao/geonet/api/records/CatalogApi.java
#	services/src/main/java/org/fao/geonet/api/records/formatters/FormatterApi.java
#	services/src/main/java/org/fao/geonet/api/tools/i18n/LanguageUtils.java
#	services/src/main/java/org/fao/geonet/api/tools/i18n/TranslationApi.java
@ianwallen ianwallen deleted the add_better_support_for_iso_iso639_2_T_and_B branch November 30, 2023 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants