Skip to content

Commit

Permalink
build: Update script to keep planning/budget/project as multilingual,…
Browse files Browse the repository at this point in the history
… but not coordinates. ci: Allow SME acronyms.
  • Loading branch information
jpmckinney committed Jun 28, 2024
1 parent 64abce1 commit 3546b52
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
with:
python-version: '3.10'
- run: pip install codespell
- run: codespell -S .git,docson,locale,examples,country.csv,currency.csv,language.csv,mediaType.csv -L fo,zar .
- run: codespell -S .git,docson,locale,examples,country.csv,currency.csv,language.csv,mediaType.csv -L fo,sme,zar,SME .
2 changes: 1 addition & 1 deletion docs/guidance/map/translations.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Two texts have the same content if they describe the same thing: for example, "U
You can publish the values of these fields in any language:

% STARTLIST
- `coordinates`, in any location
- `description`, in any location
- `finalStatusDetails`, in any location
- `legalName`, in any location
Expand All @@ -21,6 +20,7 @@ You can publish the values of these fields in any language:
- `region`, in any location
- `streetAddress`, in any location
- `title`, in any location
- `planning/budget/project`
- `tender/awardCriteriaDetails`
- `tender/procurementMethodDetails`
- `tender/procurementMethodRationale`
Expand Down
3 changes: 2 additions & 1 deletion docs/history/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ Per the [normative and non-normative content and changes policy](../governance/n

* Add new codelists:
* [#1372](https://github.com/open-contracting/standard/pull/1372) `country`
* [#1684](https://github.com/open-contracting/standard/pull/1684) `geometryType`
* [#1316](https://github.com/open-contracting/standard/pull/1316) `language`
* [#1326](https://github.com/open-contracting/standard/pull/1326) `linkRelationType`
* [#1684](https://github.com/open-contracting/standard/pull/1684) `locationGazetteers`
* [#1308](https://github.com/open-contracting/standard/pull/1308) `mediaType`
* [#1459](https://github.com/open-contracting/standard/pull/1459) `partyScale`
* [#1684](https://github.com/open-contracting/standard/pull/1684) `geometryType` and `locationGazetteers`
* [#1654](https://github.com/open-contracting/standard/pull/1654) `permission`
* [#1642](https://github.com/open-contracting/standard/pull/1642) `planningFinalStatus`
* [#1648](https://github.com/open-contracting/standard/pull/1648) `tenderFinalStatus`
Expand Down
6 changes: 4 additions & 2 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,14 +532,16 @@ def pre_commit():
jsonref_release_schema = json_load('release-schema.json', jsonref, merge_props=True)

counts = defaultdict(list)
nonstring = ('boolean', 'integer', 'number', 'object')
for field in get_schema_fields(jsonref_release_schema):
name = field.path_components[-1]
# Skip definitions (output dereferenced properties only). Skip deprecated fields.
if field.definition_pointer_components or field.deprecated:
continue
multilingual = (
# If a field can be a non-string, it is not multilingual.
not any(t in field.schema['type'] for t in ('boolean', 'integer', 'number', 'object'))
not any(t in field.schema['type'] for t in nonstring)
and ('array' not in field.schema['type'] or not any(t in field.schema['items']['type'] for t in nonstring))
# If a field's value is constrained to a codelist or format, it is not multilingual.
and not any(prop in field.schema for prop in ('codelist', 'format'))
# If an array can contain non-strings, it is not multilingual.
Expand All @@ -558,7 +560,7 @@ def pre_commit():
if multilingual:
counts[name].append(field.path)
else:
counts[name] = []
counts[name] = counts[name]

bulletlist = [
'% STARTLIST',
Expand Down

0 comments on commit 3546b52

Please sign in to comment.