-
-
Notifications
You must be signed in to change notification settings - Fork 164
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
Translate name to request language when available. #1301
Conversation
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.
With this PR, only the property name in the GeoJSON is internationalized.
Most of the time, we are using label property instead of name.
Maybe, this work should be done in changeLanguage
midleware and not in geojsonify.
Looking at the code, I see both Thoughts? |
I think you should update the api/middleware/changeLanguage.js Lines 65 to 67 in ceaf1f0
Because |
Indeed, no question there. Is my observation correct? And if so, would it maybe make sense to do |
Nope, Lines 306 to 307 in ceaf1f0
|
My bad, I was scrolled into the |
@Joxit I updated the code. I don't understand the Travis failure, could you please shed some light? |
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.
It works fine 😄
@Joxit I rebased on top of the new master. |
@Joxit testing this I realized that |
Hey @mihneadb, The services page does already have a column at the right side noting that Placeholder is required for all admin translations. Maybe we can make it more clear somehow? |
You're right, I see it now. Fail on my part. Nvm then :). I didn't read all of the Pelias code unfortunately so maybe this is a stupid question - but looking at Thanks for the help on this! Glad it turned out to work :). |
You're right that all the For example, we have 8 million addresses here in NYC. There aren't really translations for most address records, but if there were, we would store them in each record. However, there are about 100 translations for New York City and those are not stored with each record, or we would have |
Right, makes sense now. Thanks for the explanation.
On Fri, 24 May 2019 at 22:45, Julian Simioni ***@***.***> wrote:
You're right that all the name translations are present in the
Elasticsearch document, but not all of the parent fields.
For example, we have 8 million addresses here in NYC. There aren't really
translations for most address records, but if there were, we would store
them in each record. However, there are about 100 translations for New York
City and those are *not* stored with each record, or we would have 8
million * 100 = 8 billion copies of the same 100 translations in
Elasticsearch. A relational database is much better for that, and that's
why Placeholder uses SQLite
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1301?email_source=notifications&email_token=AAE5AN4ERREFKRUV5MV4LZTPXBAXHA5CNFSM4HOS7PN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWGNA6Q#issuecomment-495767674>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAE5ANZB2DP2B2N55RAEP5TPXBAXHANCNFSM4HOS7PNQ>
.
--
-- Mihnea Dobrescu-Balaur Sent from a mobile device.
|
Is there anything else I need to help with on this or is it just about testing and playing with it some more? Thanks! |
As of pelias/api#1301, it is now possible to _return translated results_ when searching for venues. This adds a new test suite of venue translation test cases, and renames the `placeholder altnames` test case to `admin translations` to match it.
a774431
to
eaf1f4e
Compare
Hi @mihneadb, I've now done so, and am super excited, this is an important bit of functionality and I think it's good to go. I found one thing that needs to be changed: it's important to only change the I've made that change, squashed your commits, updated the commit message to our format that will automatically add this feature to the package changelog, and pushed all that back to your branch so it can be merged easily. I also made some acceptance tests to verify all this behavior over in pelias/acceptance-tests#500. Thanks for taking the time to look at this! |
Right, that makes sense. Thanks a lot for taking care of this! |
These have been passing since pelias/api#1301 but we never updated them!
Context: #1296
This makes
api
choosename.LANG
when available. If it isn't possible, it defaults toname.default
as it used to.