-
Notifications
You must be signed in to change notification settings - Fork 30
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
No way to display labels in multiple languages #170
Comments
@j-dornbusch I'm wondering if you can expand on the issue you are having with an example of a label that is not translating. Here are a few observations around language processing in QA.
Authority language data comes in several varieties:authority defines literals with language tags for a single label predicateThis allows for a search with the query string in the specified language and returns results in the requested language Examples: authority defines alternate language literals in alternate labelThis allows for a search with the query string in the specified language, but the results will be returned for the primary language only (almost always English) Example: authority defines language variants linked via a bnodeQA can search other direct predicates (as seen in previous example), but does not at this time support cascading search to a bnode value. In this case, you cannot search using a query string in the alternate language. It will return 0 results.
authority defines language variants linked via a bnode and marked with the wrong language taghttp://id.loc.gov/authorities/names/n79021164.nt authority has no language supportThere are more than a few authorities where the raw data does not include language tags on the literals. A few other thoughtsIf you have a specific authority you are trying to work with, we can look into what the data supports and whether an indexing change would allow for language search. QA can support many more authorities than what comes with QA. Many of the examples here are from these additional authorities. You can see other supported linked data authorities at https://github.com/ld4p/linked_data_authorities. |
@elrayle I am sorry to answer after such a long delay.
A wrapper service is then needed to filter the appropriate language (and of course a helper or a renderer to remove the langtag before displaying the label). def select_all_options(locale = :fr)
get_authority.all.map do |element|
[apply_language_preference(element[:label], locale), element[:id]]
end.sort_by {|element| element.first.downcase}
end
def get_authority
authority = Qa::Authorities::Local.subauthority_for(@vocabulary_identifier) unless authority
end |
There seems to be no way to give labels in multiple languages. It's a problem when the underlying vocabulary is a skos vocabulary where preflabels have langtags. We can not adapt the display to the user's language preferences. Or, should we create a yaml file per language with a suffix and adapt the client code? Or replace the terms with i18n keys and put the labels in the internationalization files by adapting the code?
The text was updated successfully, but these errors were encountered: