-
Notifications
You must be signed in to change notification settings - Fork 355
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
[VUFIND-1586] Clean up language keys for file import on lokalise.com #2598
Conversation
… keys: ** Need Help? ** Send us your feedback! * updated usage of language keys in code
I fixed:
|
Thanks for getting this started, @lahmann. A few things: 1.) I wonder if we should take this opportunity to use token-style strings instead of simply removing punctuation from non-token-style strings. Since this largely impacts form configuration, I'm interested in @EreMaijala's input. It's possible that this may also be an opportunity to differentiate use of the "Need Help?" string based on context (e.g. "help_header" vs. "need_help"). 2.) The "Form Submitted!" string is indeed obsolete. I have opened #2599 to clean that up. 3.) The "Subject(s)" string is a tricky one; this was introduced as part of the EDS module. Since EDS does not support native i18n, we have to translate arbitrary strings coming back from the EDS API, and this is one of them. I think it would be helpful to handle these things in their own namespace (this functionality was implemented before we had namespaces), but refactoring everything appropriately may be challenging. Maybe we can take a first stab at that in a separate PR when time permits -- e.g. normalize EDS labels to remove punctuation and add a namespace prefix, perhaps with a fallback to the default namespace in case we miss something. I'll add a TODO checkbox about the issue. |
@demiankatz @lahmann |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use token style when the English translation doesn't match the translation key.
Sounds good. @lahmann, let me know if you plan to work on this or if you'd like some help. Also note that most of these changes can be made via VuFind's command-line language management tools, so if you're not familiar with those already, they'll likely save some time. Let me know if you need more details! |
I finally found some time to push things forward. The last commit is a draft of introducing translation tokens for the occurrences of "Need help" and - to introduce translation tokens for similar elements in the template - for all the headers in the footer columns. Let me know what you think and if I should continue with this approach. |
Regarding the EDS strings: I'm not sure if we already have an agreed upon plan how to proceed. Moving EDS related strings into a domain could be done, but apart from c88529d which introduced several (generic) translation strings I have no clue which strings are EDS specific (apart from the tokens |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @lahmann -- looks like there are just a couple more details to address.
Regarding EDS, it's really tricky, because the API can send us entirely arbitrary label text. We have no comprehensive list, and the strings cannot be found in the code. It would be much better of the API itself were internationalized, but as far as I know, EBSCO has not made plans to do that, so we're left doing the best we can.
I think this is the key place where Subject(s)
comes into play (though it may not be the only one -- I would have to do a more careful review of EDS templates to be sure): https://github.com/vufind-org/vufind/blob/dev/themes/bootstrap3/templates/RecordDriver/EDS/core.phtml#L67
One solution might be to create a translateEDSLabel
view helper which normalizes the strings, searches for translations in first an EDS namespace and then the default namespace, and returns the raw string if no translation is found anywhere. It's not elegant, but I don't think we're going to find a totally elegant solution to this problem. As noted elsewhere, I'm willing to make an attempt at this in a separate PR if you like, though I'm not sure when I'll have time to do that -- December is going to be a very busy month for me due to local system migrations, so I'm not expecting to have a lot of time for VuFind development.
Thanks for taking a look at my comment. So, the naming scheme for the tokens will do and I should go on - at least for the translation strings in question of this pull request? Regarding EDS the suggested solution via an extra view helper sounds reasonable but without having access to an EDS system implementation would be quite difficult on our side. Should we introduce an EDS domain in this ticket as a workaround for the |
@lahmann, I found a few minutes to put together a proof of concept of an EDS view helper (see #2642) and would be interested in continuing to discuss EDS issues on that PR. However, in the meantime, I believe we can simply delete the |
* remove EDS specific Subject(s) translation string
Great, thanks for going ahead with the EDS view helper. I introduced the remaining translation tokens and removed Afterthought: for more consistency I also introduced a token for the feedback form response ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @lahmann, I agree that we're nearly done. However, I did a quick search for all the language strings that have been removed and found one remaining reference to one of them (see below).
I'm also going to run the full test suite, just to be sure nothing has broken. I don't expect any problems, but if something fails, I'll post a follow-up comment.
I also see that @EreMaijala has an outstanding request for changes, so it would be good to get an approval from him as well once the final correction is made.
@lahmann, actually, there were some test failures -- looks like you may have gotten carried away with some of the string replacement in the integration tests, since they will return translated results rather than keys:
|
Time flies... Thanks for the review, I fixed the tests and added the missing "Find more" translation string for the collection template. I named it |
@lahmann, I took a closer look at the way the collection_next_page_label was being used, and it seemed to me entirely unhelpful/unnecessary -- it provided somewhat out-of-context mouseover text on the icon inside the buttons that link to collection contents. See this screen shot: I just went ahead and deleted it entirely (see 5addc62), as I don't think it was really helping anyone. Happy to put something else back in there if @crhallberg or others think it would be important/helpful. I've also updated the changelog with a summary of what we've done here, so everything is documented once we decide to go ahead and merge this. I'll leave it open a little longer for discussion first, though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as nobody objects to my collections changes above, I believe this is ready to merge. I've tested all the impacted configurations and templates and everything displays correctly. I'll just await feedback for a few days before hitting the merge button.
I have no objections either. |
Importing language files on lokalise.com results in errors aborting import due to some characters in the language keys. So far the following characters where identified:
()!?
Found language keys:
TODO: