Skip to content
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

Beneficial to have the function for language selection available in Lua Script? #4091

Closed
galewis2 opened this issue Mar 25, 2020 · 6 comments

Comments

@galewis2
Copy link

Would it be beneficial to have the ability to select language for tags be easily available in the openstreetmap-carto base repository?

All that's needed is something like in the appropriate places:
different_name = nil # or "name:en" if different_name then if keyvalues[different_name] and keyvalues["name"] then if keyvalues["name"] ~= keyvalues[different_name] then keyvalues["name"] = keyvalues["name"].."\n("..keyvalues[different_name]..")" end end end

Or is it preferred to keep this repo tidy? I see this as an often requested thing so I can see either way

@galewis2 galewis2 changed the title Beneficial to have the function for language selection available in Lua Script Beneficial to have the function for language selection available in Lua Script? Mar 27, 2020
@jeisenbe
Copy link
Collaborator

Related to #3870 - @pnorman, do you know if this suggestion is feasible and desirable?

@imagico
Copy link
Collaborator

imagico commented Mar 27, 2020

See also #803.

@galewis2
Copy link
Author

galewis2 commented Mar 27, 2020

For example I have in lua in nodes:

function filter_tags_node (keyvalues, numberofkeys)
    if keyvalues["name:en"] and keyvalues["name"] then
        if keyvalues["name"] ~= keyvalues["name:en"] then
            keyvalues["name"] = keyvalues["name"].."\n("..keyvalues["name:en"]..")"
        end
    end
    return filter_tags_generic(keyvalues)
end

It would make sense to make this language agnostic. Working on a quick import now to demo, I will upload snapshots when it's complete

@galewis2
Copy link
Author

image

Idea was extended upon from https://www.openstreetmap.org/user/demonshreder/diary/43956

@pnorman
Copy link
Collaborator

pnorman commented Mar 27, 2020

If we want to put it into the Lua file then it should be enabled by a global variable to switch it on.

I'd rather do the language conversion at generation time than when loading. Doing it when loading rules out rendering multiple languages from the one DB.

@pnorman
Copy link
Collaborator

pnorman commented Jul 18, 2022

I'd rather do the language conversion at generation time than when loading. Doing it when loading rules out rendering multiple languages from the one DB.

I'm going to close it for this reason. I'd like an easier solution to changing the rendered language for forks and other deployments, but I don't think it can involve setting the language at import time.

@pnorman pnorman closed this as completed Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants