[Pkg-isocodes-devel] [SCM] ISO language, territory, currency, script codes and their translations branch, master, updated. ba6f0b662aca3fd2ea0d902813b0a39708d5521c
Tobias Quathamer
toddy at debian.org
Thu Jun 13 13:19:04 UTC 2013
- Previous message: [Pkg-isocodes-devel] [SCM] ISO language, territory, currency, script codes and their translations branch, master, updated. ba6f0b662aca3fd2ea0d902813b0a39708d5521c
- Next message: [Pkg-isocodes-devel] [SCM] ISO language, territory, currency, script codes and their translations branch, master, updated. d1e8dde6a4d9a4ebf81ad8b4392a939cbd4e7a86
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
The following commit has been merged in the master branch:
commit 36ba84345ef0d5cccf9b64ff28ec9db6fad4433e
Author: Tobias Quathamer <toddy at debian.org>
Date: Thu Jun 13 15:13:49 2013 +0200
Support common_name attribute
diff --git a/iso_639_3/iso-dis-639-tab-parse.py b/iso_639_3/iso-dis-639-tab-parse.py
index b159e10..2e3b472 100755
--- a/iso_639_3/iso-dis-639-tab-parse.py
+++ b/iso_639_3/iso-dis-639-tab-parse.py
@@ -23,6 +23,12 @@ Parse the SIL.org iso_639_3.tab file and create
an XML file for our own use.
"""
+# We support the common_name attribute, which will get lost
+# during the generation of the xml file. Therefore, define
+# the codes with their common names here.
+common_names = {}
+common_names['ben'] = "Bangla"
+
# The Name_Index file only has the fields
# Id, Print_Name, and Inverted_Name.
# There may be multiple lines with the same Id.
@@ -55,6 +61,8 @@ def create_iso_639_3_entry(entry):
if 'inverted_name' in entry:
result += '\t\tinverted_name="%s"\n' % entry['inverted_name']
result += '\t\treference_name="%s"\n' % entry['reference_name']
+ if 'common_name' in entry:
+ result += '\t\tcommon_name="%s"\n' % entry['common_name']
# Use the inverted form for the name attribute
if 'inverted_name' in entry:
result += '\t\tname="%s" />\n' % entry['inverted_name']
@@ -103,6 +111,7 @@ Source: <http://www.sil.org/iso639-3/>
inverted_name CDATA #IMPLIED
reference_name CDATA #REQUIRED
name CDATA #REQUIRED
+ common_name CDATA #IMPLIED
>
]>
@@ -138,6 +147,8 @@ for li in tabular_file.readlines():
iso_639_3_entry['reference_name'] = reference_name
if reference_name in inverted_names:
iso_639_3_entry['inverted_name'] = inverted_names[reference_name]
+ if code in common_names:
+ iso_639_3_entry['common_name'] = common_names[code]
entry = create_iso_639_3_entry(iso_639_3_entry)
xml_file.write(entry)
--
ISO language, territory, currency, script codes and their translations
- Previous message: [Pkg-isocodes-devel] [SCM] ISO language, territory, currency, script codes and their translations branch, master, updated. ba6f0b662aca3fd2ea0d902813b0a39708d5521c
- Next message: [Pkg-isocodes-devel] [SCM] ISO language, territory, currency, script codes and their translations branch, master, updated. d1e8dde6a4d9a4ebf81ad8b4392a939cbd4e7a86
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Pkg-isocodes-devel
mailing list