Enable translation for the remaining strings on the search results page #752
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A few strings on the search results pages were hard coded an not enclosed with the translation function which gave the page a half translated impression.
Description
text
dict inquery.html
for matching
/captures of
by
Mime Type
HTTP Status
query.js
query.js
for consistencytsToDate()
function also for the timestamps for search results without matchTypedocument.documentElement.lang
parameter to decide how to localize the timestamps inquery.js
The last item means that if the user has chosen a language for the page the timestamps will be formatted accordingly; otherwise the locale of the browser will control the formatting. It is totally feasible to use different language settings for the browser and the content.
Motivation and Context
All other pages can be completely localized. This was as far as I can tell the remaining missing strings.
Screenshots (if appropriate):
Before:
After:
(The National Library logo and the "Logga in" link are local customizations and not part of this change.)
Types of changes
Checklist:
The
python setup.py test
command fails early with a versioning conflict when running locally - with or without this change. I appears that the test subsystem does not care about version limitations in requirements.txt when installing python modules. As this is a non-functional change, there probably aren't any test for it anyway.Trying to use localized ordinal suffixes for dates is a hard problem as there is no built in support for it in Javascript which I guess is why most timestamp-to-string implementations don't use ordinal suffixes.