The CLDRModify tool can be used to make changes to a number of files, based on a configuration file.
As an example of how this is done, and the results, see: http://unicode.org/cldr/trac/changeset/9108 File FormatThe file format is a series of lines of the form: ConfigKeys1=ConfigMatch1 ; ConfigKeys2=ConfigMatch2 ; ... DebuggingThe following line shows the number of file lines that are applicable to this locale. It may be helpful in debugging. # Checking entries & adding: 2
You can also search for /fixList.add('k',/ in the file, and put a breakpoint in handleStart or handlePath.
ConfigKeyslocale, action, path, value, new_path, new_value A locale (regex) must be present. Not all of {path, value, new_path, new_value} will be present (or can be), depending on the action.
ConfigMatchFor the action, see below. Everything else can be a regex or an exact string. // Use a string of "/.../" for a regex match, otherwise an action, otherwise an exact string match. If the locale is /./, then any locale matches. Warning! This won't work if you need certain literal characters (such as ; or a leading or trailing space, etc.). See TODO.
ConfigActionaction=deleteIf there is a match for the value and path and locale, then the action is taken. If the path is empty, any path matches. If the value is empty, any value matches. action=addThe new_path and new_value are explicit strings, and the <new_path, new_value> are added to the files that match the locale. action=addNewSame as add, but only for paths that don't have values in the original value.
Example filelocale= sv ; action=delete; value= YER ; path= //ldml/numbers/currencies/currency[@type="YER"]/symbol ; locale=en ; action=delete ; path=/.*short.*/ locale=en ; action=add ; new_path=//ldml/localeDisplayNames/territories/territory[@type="PS"][@alt="short"] ; new_value=Palestine Path IdsAn exact path can be either the literal string or a hex id. So the following are equivalent:
locale= sk ; action=add ; new_path=68e706b7c7873181 ; new_value=honduraskej lempiry
locale= sk ; action=add ; new_path=//ldml/numbers/currencies/currency[@type="HNL"]/displayName[@count="many"] ; new_value=honduraskej lempiry TODOChange add so that path and/or value can be present, and if so, $0..$9 will be substituted for in the respective new_path or new_value. After splitting at ";", change \x3B and other \x{H..H} characters into ";".
|