Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F9888668
D523.id1278.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D523.id1278.diff
View Options
diff --git a/create_given_name b/create_given_name
--- a/create_given_name
+++ b/create_given_name
@@ -66,12 +66,18 @@
'U': 'l10n/givenname-u.json'
}
+# Gets whitelist latin languages to avoid create the element in other scripts.
+with open('l10n/latin-whitelist.json') as data_file:
+ latin_languages = json.load(data_file)
+
# Gets descriptions from l10n file, and fill labels for these languages.
script_directory = os.path.dirname(os.path.realpath(__file__))
l10n_file = os.path.join(script_directory, l10n_files[genre])
with open(l10n_file) as data_file:
descriptions = json.load(data_file)
-labels = {lang:givenname for lang in descriptions.keys()}
+
+labels_languages = set(descriptions.keys()).intersection(latin_languages)
+labels = {lang:givenname for lang in labels_languages}
item.editLabels(labels, summary='Adding given name labels')
item.editDescriptions(descriptions, summary='Adding given name descriptions')
diff --git a/create_surname b/create_surname
--- a/create_surname
+++ b/create_surname
@@ -42,12 +42,18 @@
item = pywikibot.ItemPage(repo, title=title)
item.get()
+# Gets whitelist latin languages to avoid create the element in other scripts.
+with open('l10n/latin-whitelist.json') as data_file:
+ latin_languages = json.load(data_file)
+
# Gets descriptions from l10n file, and fill labels for these languages.
script_directory = os.path.dirname(os.path.realpath(__file__))
l10n_file = os.path.join(script_directory, 'l10n', 'surname.json')
with open(l10n_file) as data_file:
descriptions = json.load(data_file)
-labels = {lang: surname for lang in descriptions.keys()}
+
+labels_languages = set(descriptions.keys()).intersection(latin_languages)
+labels = {lang: surname for lang in latin_languages}
item.editLabels(labels, summary='Adding surname labels')
item.editDescriptions(descriptions, summary='Adding surname descriptions')
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jun 16, 19:06 (6 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2734312
Default Alt Text
D523.id1278.diff (1 KB)
Attached To
Mode
D523: Use latin script languages whitelist
Attached
Detach File
Event Timeline
Log In to Comment