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

Remove app specific stuff from the config #2622

Open
hangy opened this issue Nov 18, 2019 · 2 comments
Open

Remove app specific stuff from the config #2622

hangy opened this issue Nov 18, 2019 · 2 comments
Labels
config dev Everything regarding the process of development 🌐 i18n Regarding software localization NGINX P2 refactor

Comments

@hangy
Copy link
Member

hangy commented Nov 18, 2019

The nginx config for off contains 4 country specific links to a French donation page

if ($host = donnez.openfoodfacts.org) { return 302 https://fr.openfoodfacts.org/faire-un-don-a-open-food-facts ; }
if ($host = don.openfoodfacts.org) { return 302 https://fr.openfoodfacts.org/faire-un-don-a-open-food-facts ; }
if ($host = dons.openfoodfacts.org) { return 302 https://fr.openfoodfacts.org/faire-un-don-a-open-food-facts ; }
if ($host = donner.openfoodfacts.org) { return 302 https://fr.openfoodfacts.org/faire-un-don-a-open-food-facts ; }
and a link to the worldwide English donation page
if ($host = donate.openfoodfacts.org) { return 302 https://world.openfoodfacts.org/donate-to-open-food-facts ; }
, and also contains a bunch of language/country(?) specific location directives
location = /donate-to-open-food-facts {
try_files /donate/en.html =404;
}
location = /faire-un-don-a-open-food-facts {
try_files /donate/fr.helloasso.html =404;
}
location = /dona-a-open-food-facts {
try_files /donate/it.html =404;
}
location = /spenden {
try_files /donate/de.html =404;
}
location = /doner-til-open-food-facts {
try_files /donate/da.html =404;
}
location = /doniraj-k-open-food-facts {
try_files /donate/sl.html =404;
}
location = /open-food-factse-bagista-bulununs {
try_files /donate/tr.html =404;
}
location = /pozhertvovat-open-food-facts {
try_files /donate/ru.html =404;
}
location = /donate-to-open-food-facts-ru {
try_files /donate/ru.html =404;
}
location = /donate-to-open-food-facts-he {
try_files /donate/he.html =404;
}
location = /fazer-um-donativo-ao-open-food-facts {
try_files /donate/pt.html =404;
}
location = /lahjoita-open-food-factsille {
try_files /donate/fi.html =404;
}
location = /dar-a-open-food-facts {
try_files /donate/es.html =404;
}
location = /haz-su-donacion-a-open-food-facts {
try_files /donate/es.html =404;
}
for donation pages

Additionally, the redirects are not even synced for several domains, as seen here

if ($host = donner.openfoodfacts.org) { return 302 https://www.helloasso.com/associations/open-food-facts/collectes/aidez-open-food-facts-a-ameliorer-l-alimentation-de-tous ; }
if ($host = donate.openfoodfacts.org) { return 302 https://www.helloasso.com/associations/open-food-facts/formulaires/1/widget/en ; }
if ($host = donner.openfoodfacts.org) { return 302 https://www.helloasso.com/associations/open-food-facts/collectes/aidez-open-food-facts-a-ameliorer-l-alimentation-de-tous ; }
if ($host = donate.openfoodfacts.org) { return 302 https://www.helloasso.com/associations/open-food-facts/formulaires/1/widget/en ; }

In my opinion, the nginx configuration is a really bad place to put this configuration for several reasons

  1. It's not consistent with the rest of the application: Internationalized links are stored in .po files or based on some filename throughout ProductOpener, and ProductOpener is the one instance that should be responsible to dispatch between those files.
  2. ProductOpener used to be the one source responsible to display HTML files of the /html directory in the git repository - inconsistent behaviour
  3. Why would the don subdomain be used for the French donne URL instead of the English donate page?
  4. Why would a single country need four different links for donation pages/URLs?!
  5. If this is purely for promotional purposes, a separate URL shortener (ie. host it in Docker!) might be a better option.
  6. We support over 100 languages and nearly 300 countries. If we acted fairly, we'd need a separate subdomain for every countries and/or languages donation page. I don't need to explain that this would be a madness to configure?
  7. Generally speaking, there's no real advantage to a URL donnez.openfoodfacts.org instead of fr.openfoodfacts.org/donate (or fr.openfoodfacts.org/donnez if you must). If a shorter URL is required, an actual URL shortener could be used instead.
@hangy hangy added the dev Everything regarding the process of development label Nov 18, 2019
@VaiTon VaiTon added 🌐 i18n Regarding software localization NGINX P2 labels Nov 18, 2019
@teolemon
Copy link
Member

teolemon commented Dec 1, 2019

Basically, we've tried handing over responsability of translating links to translators, but the current system is very error prone, and we pedaled back.
Also, URLs are forever. Thus the more centralized solution.

There's a proposal to solve URLs in static content, which would be a lifechanger for me, and improve the feeling of localisation by enabling stable, translated urls in a reliable way (and we could extend that to common.pot).
#1818

@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2020

Stale issue message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config dev Everything regarding the process of development 🌐 i18n Regarding software localization NGINX P2 refactor
Projects
Status: To discuss and validate
Development

No branches or pull requests

3 participants