Skip to content

Commit e04dd36

Browse files
authored
Improve Singapore Address Format (#136)
* Improve README description of template authoring * Fix Singapore address format
1 parent 0644e31 commit e04dd36

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ _Please note: the list is simple all officially assigned [ISO 3166-1 alpha-2 cod
8787

8888
### File format
8989

90-
The files are in [YAML](http://yaml.org/) format. The templates are written in [Mustache](http://mustache.github.io/). Both formats are human readable, strict, solve escaping and support comments. YAML allows references (called "ankers") to avoid copy&paste, Mustache allows sub-templates (called "partials").
90+
The files are in [YAML](http://yaml.org/) format. The templates are written in [Mustache](http://mustache.github.io/) with a minor variation: the `{#first}` sections will take the first alternative for which a variable could be interpolated. Both formats are human readable, strict, solve escaping and support comments. YAML allows references (called "ankers") to avoid copy&paste, Mustache allows sub-templates (called "partials").
9191

9292
### How to add your country/territory
9393

@@ -101,14 +101,15 @@ The files are in [YAML](http://yaml.org/) format. The templates are written in [
101101

102102
2. edit `conf/countries/worldwide.yaml`
103103
* Possibly your country/territory uses an existing generic format as
104-
defined at the top of the file. If so, great, just map you
104+
defined at the top of the file. If so, great! Just map your
105105
country_code to the generic template. You may still want to add
106106
clean up code (see the entry for `DE` as an example).
107-
* If not you need to define a new generic rule set
108-
* possibly you will need to define new state/region mappings in `conf/state_codes.yaml`
107+
* If not, you need to define a new rule set (may or may not be generic)
108+
* You may also need to define new state/region mappings in `conf/state_codes.yaml`
109109

110-
3. to test you will now need to process the .yaml test via a processer
110+
3. to test you will now need to process the .yaml test via a processor
111111
(see above) and ensure the input leads to the desired output.
112+
We also run these checks automatically against pull requests to ensure against regressions.
112113

113114
If in doubt, please get in touch by submitting an issue.
114115

conf/countries/worldwide.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1805,7 +1805,6 @@ SG:
18051805
{{{house}}}, {{{quarter}}}
18061806
{{{house_number}}} {{{road}}}, {{{residential}}}
18071807
{{#first}} {{{country}}} || {{{town}}} || {{{city}}} || {{{municipality}}} || {{{hamlet}}} || {{{village}}} || {{{county}}} {{/first}} {{{postcode}}}
1808-
{{{country}}}
18091808
18101809
# Saint Helena, Ascension and Tristan da Cunha - same as UK
18111810
SH:

testcases/countries/sg.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ components:
2323
expected: |
2424
16 Sandilands Road
2525
Singapore 546080
26-
Singapore
2726
---
2827
description: no city, 1.30585,103.78158
2928
components:
@@ -38,7 +37,6 @@ components:
3837
expected: |
3938
26 Dover Crescent, Dover Gardens
4039
Singapore 130026
41-
Singapore
4240
---
4341
description: wrong city, 1.30585,103.78158
4442
components:
@@ -54,6 +52,3 @@ components:
5452
expected: |
5553
26 Dover Crescent, Dover Gardens
5654
Singapore 130026
57-
Singapore
58-
59-

0 commit comments

Comments
 (0)