omeka-s icon indicating copy to clipboard operation
omeka-s copied to clipboard

Site locale + "Filter values" on browse pages

Open allanaaa opened this issue 1 year ago • 3 comments

There is a mismatch between site locale settings that are not two letters (e.g. "de_DE") and the two-letter language codes on item values. When "filter values" is checked, Browse pages will correctly show values in "fr", "it", "es", etc., but not values in "tr" where the site is "tr_TR", "de" for "de_DE", etc.

This is true in all themes I've tested it on. As you know, we don't let language entries on item values be more than two letters so there's no way to specify to that degree.

allanaaa avatar Jul 25 '23 19:07 allanaaa

You can have longer language entries on values: de-DE, etc. The accepted tags are BCP 47 tags, as described for example here; the subparts are separated by hyphens. The "underscore" syntax we use to name the translations comes to us from a slightly different standard.

I've thought about having it be able to match more "loosely" where appropriate for the filtering feature, in the sense of accepting everything with the same top level language, or everything "under" the selected locale, etc.

zerocrates avatar Jul 25 '23 19:07 zerocrates

Ohhh, underscores versus hyphens. I didn't try that. Yeah, that will confuse people. We should do both underscore/hyphen conversion and parent-fallback behind the scenes. And document it thoroughly. Maybe put some guides in the interface.

I wonder if sibling languages should look for each other too, like if there's no pt_PT look for pt_BR.....

The installation+site settings locale list just comes from Transifex entries, right? Anything above some threshold?

allanaaa avatar Jul 25 '23 19:07 allanaaa

The view I came to on how "loose" the matching should be was that ultimately where it would end up mattering we probably wouldn't be able to make any one decision that would make sense everywhere so it'd end up having to be a setting or multiple:

  • should you just give a parent language and everything under that matches
  • if you specify a region or script should other text not matching that also get included if in the same language: particularly thinking in areas like Chinese where different regions imply different scripts (or the scripts themselves can be the subtag)
  • should non-tagged strings be considered matching or not

The list of choices is just what translations are available, yes. We ship any language that has at least 10% of the strings translated (or something similar to that). Being able to set the restriction in values on a site to a locale that's not one of the translations is also one of the factors of this possible cavalcade of options.

zerocrates avatar Jul 26 '23 20:07 zerocrates