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

Improve handling of site specific translations, content, texts, images, taxonomies etc. in git for OFF, OBF, OPF, OPFF etc. #1536

Open
Tracked by #5555 ...
stephanegigandet opened this issue Nov 25, 2018 · 3 comments
Assignees
Labels
🌐 i18n Regarding software localization 🧴 Open Beauty Facts Our cosmetic analysis project https://world.openbeautyfacts.org 🐾 Open Pet Food Facts Our pet food analysis project https://world.openpetfoodfacts.org 📸 Open Products Facts Our project to increase the lifespan of objects. https://world.openproductsfacts.org 🎯 P0 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies

Comments

@stephanegigandet
Copy link
Contributor

stephanegigandet commented Nov 25, 2018

We used to have only Open Food Facts (OFF) and then we added Open Beauty Facts, Open Pet Food Facts, Open Products Facts. All the sites share the same code, but they share only parts of translations, taxonomies etc. We need a better system to store in github the site specific content.

An option is to add a $site_id variable in Config2.pm, which would be either "off" or "openbeautyfacts", and then we use that to add a sublevel in the directory structure, like we currently have for translations in the /po/ dir:

lrwxrwxrwx 1 off root 13 Jul 9 16:51 site-specific -> openfoodfacts
drwxr-xr-x 2 off off 4096 Nov 5 16:47 openfoodfacts
drwxr-xr-x 2 off off 4096 Nov 7 15:36 openbeautyfacts
drwxr-xr-x 2 off off 4096 Nov 7 15:36 openpetfoodfacts
drwxr-xr-x 2 off off 4096 Nov 7 15:36 openproductsfacts
drwxr-xr-x 2 off off 4096 Nov 8 14:34 common

But instead of using symlinks like the "site-specific", we use the $site_id variable from the Config2.pm configuration file.

We also create a common directory that we load first, and that can be overridden by site specific content.

Directories with site specific content:

/taxonomies : create /taxonomies/common/ (e.g. languages, countries) and /taxonomies/openfoodfacts/ingredients.txt etc.
/images/misc/favicon
/lang

Part of

@stephanegigandet stephanegigandet added 🌐 i18n Regarding software localization 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies 🧴 Open Beauty Facts Our cosmetic analysis project https://world.openbeautyfacts.org 🐾 Open Pet Food Facts Our pet food analysis project https://world.openpetfoodfacts.org 📸 Open Products Facts Our project to increase the lifespan of objects. https://world.openproductsfacts.org labels Nov 25, 2018
@stephanegigandet stephanegigandet self-assigned this Nov 25, 2018
@NerOcrO
Copy link
Contributor

NerOcrO commented Nov 27, 2018

@hangy
Copy link
Member

hangy commented Nov 27, 2018

Would it also be possible to load https://github.com/openfoodfacts/openfoodfacts-server/blob/69593e6e7c6b9599284e7b0e39cce80a51b579e5/lib/ProductOpener/SiteQuality.pm dynamically, based on the $site_id value, and fallback to an implementation that does nothing, if $site_id != 'off'?

@NerOcrO
Copy link
Contributor

NerOcrO commented Nov 27, 2018

No more symbolic link please...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌐 i18n Regarding software localization 🧴 Open Beauty Facts Our cosmetic analysis project https://world.openbeautyfacts.org 🐾 Open Pet Food Facts Our pet food analysis project https://world.openpetfoodfacts.org 📸 Open Products Facts Our project to increase the lifespan of objects. https://world.openproductsfacts.org 🎯 P0 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies
Projects
Status: To discuss and validate
Status: To do
Status: To do
Status: To Discuss & Validate
Development

No branches or pull requests

4 participants