Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: filters/to_og_locale.py

Issue 29680647: Issue 5329 - Provide a template for social media meta data in website-defaults (Closed) Base URL: https://hg.adblockplus.org/website-defaults
Patch Set: Rebased Created Jan. 31, 2018, 11:39 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | includes/meta/social.tmpl » ('j') | includes/meta/social.tmpl » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: filters/to_og_locale.py
===================================================================
new file mode 100644
--- /dev/null
+++ b/filters/to_og_locale.py
@@ -0,0 +1,33 @@
+og_locales = {
+ 'ar': 'ar_AR',
+ 'bg': 'bg_BG',
+ 'de': 'de_DE',
+ 'da': 'da_DK',
+ 'en': 'en_US',
+ 'es': 'es_ES',
+ 'es_MX': 'es_LA',
+ 'fr': 'fr_FR',
+ 'el': 'el_GR',
+ 'he': 'he_HE',
+ 'hu': 'hu_HU',
+ 'it': 'it_IT',
+ 'ms': 'ms_MY',
+ 'ja': 'ja_JP',
+ 'ko': 'ko_KR',
+ 'lt': 'lt_LT',
+ 'nl': 'nl_NL',
+ 'pl': 'pl_PL',
+ 'pt': 'pt_PT',
+ 'pt_BR': 'pt_BR',
+ 'ru': 'ru_RU',
+ 'sk': 'sk_SK',
+ 'th': 'th_TH',
+ 'tr': 'tr_TR',
+ 'vi': 'vi_VN',
+ 'zh_CN': 'zh_CN',
+ 'zh_TW': 'zh_TW',
+}
+
+def to_og_locale(locale):
+ return og_locales[locale] if locale in og_locales else locale
+
juliandoucette 2018/01/31 19:03:22 NIT: Extra whitespace
ire 2018/02/01 09:07:02 Done.
« no previous file with comments | « no previous file | includes/meta/social.tmpl » ('j') | includes/meta/social.tmpl » ('J')

Powered by Google App Engine
This is Rietveld