worldwide 1.30.3 → 1.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -5
  3. data/Gemfile.lock +1 -1
  4. data/README.md +33 -0
  5. data/data/cldr/locales/sr/calendars.yml +232 -232
  6. data/data/cldr/locales/sr/characters.yml +4 -5
  7. data/data/cldr/locales/sr/currencies.yml +1134 -1134
  8. data/data/cldr/locales/sr/fields.yml +426 -424
  9. data/data/cldr/locales/sr/languages.yml +508 -508
  10. data/data/cldr/locales/sr/lists.yml +12 -12
  11. data/data/cldr/locales/sr/numbers.yml +108 -108
  12. data/data/cldr/locales/sr/rbnf.yml +123 -123
  13. data/data/cldr/locales/sr/subdivisions.yml +2478 -2478
  14. data/data/cldr/locales/sr/territories.yml +294 -294
  15. data/data/cldr/locales/sr/timezones.yml +765 -765
  16. data/data/cldr/locales/sr/units.yml +230 -230
  17. data/data/cldr/locales/sr-Cyrl/characters.yml +1 -12
  18. data/data/cldr/parent_locales.yml +1 -2
  19. data/data/cldr/paths.txt +0 -13
  20. data/data/other/generated/sr-Latn-BA.yml +17 -17
  21. data/data/other/generated/sr-Latn-ME.yml +15 -15
  22. data/data/other/generated/sr-Latn-RS.yml +15 -15
  23. data/data/other/generated/sr-Latn-XK.yml +15 -15
  24. data/data/other/generated/sr-Latn.yml +15 -15
  25. data/data/other/generated/sr.yml +73 -73
  26. data/data/other/paths.txt +0 -1
  27. data/data/regions/BR.yml +11 -0
  28. data/data/regions/KW.yml +7 -0
  29. data/data/regions/PA.yml +7 -0
  30. data/data/regions/PE.yml +7 -0
  31. data/data/regions/PH.yml +7 -0
  32. data/docs/address_format_strings.md +8 -0
  33. data/lib/worldwide/region.rb +21 -1
  34. data/lib/worldwide/regions_loader.rb +2 -0
  35. data/lib/worldwide/version.rb +1 -1
  36. metadata +1 -15
  37. data/data/cldr/locales/sr-Cyrl/calendars.yml +0 -375
  38. data/data/cldr/locales/sr-Cyrl/currencies.yml +0 -1673
  39. data/data/cldr/locales/sr-Cyrl/delimiters.yml +0 -10
  40. data/data/cldr/locales/sr-Cyrl/fields.yml +0 -669
  41. data/data/cldr/locales/sr-Cyrl/languages.yml +0 -511
  42. data/data/cldr/locales/sr-Cyrl/lists.yml +0 -33
  43. data/data/cldr/locales/sr-Cyrl/numbers.yml +0 -189
  44. data/data/cldr/locales/sr-Cyrl/plurals.rb +0 -1
  45. data/data/cldr/locales/sr-Cyrl/rbnf.yml +0 -288
  46. data/data/cldr/locales/sr-Cyrl/subdivisions.yml +0 -2481
  47. data/data/cldr/locales/sr-Cyrl/territories.yml +0 -297
  48. data/data/cldr/locales/sr-Cyrl/timezones.yml +0 -1537
  49. data/data/cldr/locales/sr-Cyrl/units.yml +0 -546
  50. data/data/other/hand_translated/sr.yml +0 -15
@@ -29,13 +29,13 @@ sr-Latn-BA:
29
29
  default: "%-d.%-m.%Y."
30
30
  billing: "%-d.%-m.%Y."
31
31
  yearless_ordinal: "%{ordinalized_day} %B"
32
- today_at_time: Danas u %02k:%M
33
- yesterday_at_time: Juče u %02k:%M
34
- tomorrow_at_time: Sutra u %02k:%M
35
- on_weekday_at_time: u %A u %02k:%M
36
- on_date_time_current_year: "%-d. %b u %02k:%M"
32
+ today_at_time: "%02k:%M danas"
33
+ yesterday_at_time: "%02k:%M juče"
34
+ tomorrow_at_time: "%02k:%M sutra"
35
+ on_weekday_at_time: "%02k:%M %A"
36
+ on_date_time_current_year: "%02k:%M %-d. %b"
37
37
  on_date: "%-d. %b %Y."
38
- ago: Pre %{time}
38
+ ago: "%{time} ago"
39
39
  x_hours_ago:
40
40
  few: prije %{count} sata
41
41
  one: prije %{count} sata
@@ -90,8 +90,8 @@ sr-Latn-BA:
90
90
  - novembar
91
91
  - decembar
92
92
  relative_day_names:
93
- this_week: ove nedelje
94
- this_month: ovog meseca
93
+ this_week: ove nedjelje
94
+ this_month: ovog mjeseca
95
95
  day_before_yesterday: prekjuče
96
96
  yesterday: juče
97
97
  today: danas
@@ -130,13 +130,13 @@ sr-Latn-BA:
130
130
  short: "%-d. %b %02k:%M"
131
131
  billing: "%-d.%-m.%Y."
132
132
  yearless_ordinal: "%{ordinalized_day} %B"
133
- today_at_time: Danas u %02k:%M
134
- yesterday_at_time: Juče u %02k:%M
135
- tomorrow_at_time: Sutra u %02k:%M
136
- on_weekday_at_time: u %A u %02k:%M
137
- on_date_time_current_year: "%-d. %b u %02k:%M"
133
+ today_at_time: "%02k:%M danas"
134
+ yesterday_at_time: "%02k:%M juče"
135
+ tomorrow_at_time: "%02k:%M sutra"
136
+ on_weekday_at_time: "%02k:%M %A"
137
+ on_date_time_current_year: "%02k:%M %-d. %b"
138
138
  on_date: "%-d. %b %Y."
139
- ago: Pre %{time}
139
+ ago: "%{time} ago"
140
140
  x_hours_ago:
141
141
  few: prije %{count} sata
142
142
  one: prije %{count} sata
@@ -146,7 +146,7 @@ sr-Latn-BA:
146
146
  one: prije %{count} minuta
147
147
  other: prije %{count} minuta
148
148
  cc_expiry_date: "%m/%Y"
149
- am: pre podne
150
- pm: po podne
151
- just_now: Upravo sada
149
+ am: am
150
+ pm: pm
151
+ just_now: sada
152
152
  yesterday: juče
@@ -29,13 +29,13 @@ sr-Latn-ME:
29
29
  default: "%-d.%-m.%Y."
30
30
  billing: "%-d.%-m.%Y."
31
31
  yearless_ordinal: "%{ordinalized_day} %B"
32
- today_at_time: Danas u %02k:%M
33
- yesterday_at_time: Juče u %02k:%M
34
- tomorrow_at_time: Sutra u %02k:%M
35
- on_weekday_at_time: u %A u %02k:%M
36
- on_date_time_current_year: "%-d. %b u %02k:%M"
32
+ today_at_time: "%02k:%M danas"
33
+ yesterday_at_time: "%02k:%M juče"
34
+ tomorrow_at_time: "%02k:%M sutra"
35
+ on_weekday_at_time: "%02k:%M %A"
36
+ on_date_time_current_year: "%02k:%M %-d. %b"
37
37
  on_date: "%-d. %b %Y."
38
- ago: Pre %{time}
38
+ ago: "%{time} ago"
39
39
  x_hours_ago:
40
40
  few: pre %{count} sata
41
41
  one: pre %{count} sata
@@ -130,13 +130,13 @@ sr-Latn-ME:
130
130
  short: "%-d. %b %02k:%M"
131
131
  billing: "%-d.%-m.%Y."
132
132
  yearless_ordinal: "%{ordinalized_day} %B"
133
- today_at_time: Danas u %02k:%M
134
- yesterday_at_time: Juče u %02k:%M
135
- tomorrow_at_time: Sutra u %02k:%M
136
- on_weekday_at_time: u %A u %02k:%M
137
- on_date_time_current_year: "%-d. %b u %02k:%M"
133
+ today_at_time: "%02k:%M danas"
134
+ yesterday_at_time: "%02k:%M juče"
135
+ tomorrow_at_time: "%02k:%M sutra"
136
+ on_weekday_at_time: "%02k:%M %A"
137
+ on_date_time_current_year: "%02k:%M %-d. %b"
138
138
  on_date: "%-d. %b %Y."
139
- ago: Pre %{time}
139
+ ago: "%{time} ago"
140
140
  x_hours_ago:
141
141
  few: pre %{count} sata
142
142
  one: pre %{count} sata
@@ -146,7 +146,7 @@ sr-Latn-ME:
146
146
  one: pre %{count} minuta
147
147
  other: pre %{count} minuta
148
148
  cc_expiry_date: "%m/%Y"
149
- am: pre podne
150
- pm: po podne
151
- just_now: Upravo sada
149
+ am: am
150
+ pm: pm
151
+ just_now: sada
152
152
  yesterday: juče
@@ -29,13 +29,13 @@ sr-Latn-RS:
29
29
  default: "%-d.%-m.%Y."
30
30
  billing: "%-d.%-m.%Y."
31
31
  yearless_ordinal: "%{ordinalized_day} %B"
32
- today_at_time: Danas u %02k:%M
33
- yesterday_at_time: Juče u %02k:%M
34
- tomorrow_at_time: Sutra u %02k:%M
35
- on_weekday_at_time: u %A u %02k:%M
36
- on_date_time_current_year: "%-d. %b u %02k:%M"
32
+ today_at_time: "%02k:%M danas"
33
+ yesterday_at_time: "%02k:%M juče"
34
+ tomorrow_at_time: "%02k:%M sutra"
35
+ on_weekday_at_time: "%02k:%M %A"
36
+ on_date_time_current_year: "%02k:%M %-d. %b"
37
37
  on_date: "%-d. %b %Y."
38
- ago: Pre %{time}
38
+ ago: "%{time} ago"
39
39
  x_hours_ago:
40
40
  few: pre %{count} sata
41
41
  one: pre %{count} sata
@@ -130,13 +130,13 @@ sr-Latn-RS:
130
130
  short: "%-d. %b %02k:%M"
131
131
  billing: "%-d.%-m.%Y."
132
132
  yearless_ordinal: "%{ordinalized_day} %B"
133
- today_at_time: Danas u %02k:%M
134
- yesterday_at_time: Juče u %02k:%M
135
- tomorrow_at_time: Sutra u %02k:%M
136
- on_weekday_at_time: u %A u %02k:%M
137
- on_date_time_current_year: "%-d. %b u %02k:%M"
133
+ today_at_time: "%02k:%M danas"
134
+ yesterday_at_time: "%02k:%M juče"
135
+ tomorrow_at_time: "%02k:%M sutra"
136
+ on_weekday_at_time: "%02k:%M %A"
137
+ on_date_time_current_year: "%02k:%M %-d. %b"
138
138
  on_date: "%-d. %b %Y."
139
- ago: Pre %{time}
139
+ ago: "%{time} ago"
140
140
  x_hours_ago:
141
141
  few: pre %{count} sata
142
142
  one: pre %{count} sata
@@ -146,7 +146,7 @@ sr-Latn-RS:
146
146
  one: pre %{count} minuta
147
147
  other: pre %{count} minuta
148
148
  cc_expiry_date: "%m/%Y"
149
- am: pre podne
150
- pm: po podne
151
- just_now: Upravo sada
149
+ am: am
150
+ pm: pm
151
+ just_now: sada
152
152
  yesterday: juče
@@ -29,13 +29,13 @@ sr-Latn-XK:
29
29
  default: "%-d.%-m.%Y."
30
30
  billing: "%-d.%-m.%Y."
31
31
  yearless_ordinal: "%{ordinalized_day} %B"
32
- today_at_time: Danas u %02k:%M
33
- yesterday_at_time: Juče u %02k:%M
34
- tomorrow_at_time: Sutra u %02k:%M
35
- on_weekday_at_time: u %A u %02k:%M
36
- on_date_time_current_year: "%-d. %b u %02k:%M"
32
+ today_at_time: "%02k:%M danas"
33
+ yesterday_at_time: "%02k:%M juče"
34
+ tomorrow_at_time: "%02k:%M sutra"
35
+ on_weekday_at_time: "%02k:%M %A"
36
+ on_date_time_current_year: "%02k:%M %-d. %b"
37
37
  on_date: "%-d. %b %Y."
38
- ago: Pre %{time}
38
+ ago: "%{time} ago"
39
39
  x_hours_ago:
40
40
  few: pre %{count} sata
41
41
  one: pre %{count} sata
@@ -130,13 +130,13 @@ sr-Latn-XK:
130
130
  short: "%-d. %b %02k:%M"
131
131
  billing: "%-d.%-m.%Y."
132
132
  yearless_ordinal: "%{ordinalized_day} %B"
133
- today_at_time: Danas u %02k:%M
134
- yesterday_at_time: Juče u %02k:%M
135
- tomorrow_at_time: Sutra u %02k:%M
136
- on_weekday_at_time: u %A u %02k:%M
137
- on_date_time_current_year: "%-d. %b u %02k:%M"
133
+ today_at_time: "%02k:%M danas"
134
+ yesterday_at_time: "%02k:%M juče"
135
+ tomorrow_at_time: "%02k:%M sutra"
136
+ on_weekday_at_time: "%02k:%M %A"
137
+ on_date_time_current_year: "%02k:%M %-d. %b"
138
138
  on_date: "%-d. %b %Y."
139
- ago: Pre %{time}
139
+ ago: "%{time} ago"
140
140
  x_hours_ago:
141
141
  few: pre %{count} sata
142
142
  one: pre %{count} sata
@@ -146,7 +146,7 @@ sr-Latn-XK:
146
146
  one: pre %{count} minuta
147
147
  other: pre %{count} minuta
148
148
  cc_expiry_date: "%m/%Y"
149
- am: pre podne
150
- pm: po podne
151
- just_now: Upravo sada
149
+ am: am
150
+ pm: pm
151
+ just_now: sada
152
152
  yesterday: juče
@@ -29,13 +29,13 @@ sr-Latn:
29
29
  default: "%-d.%-m.%Y."
30
30
  billing: "%-d.%-m.%Y."
31
31
  yearless_ordinal: "%{ordinalized_day} %B"
32
- today_at_time: Danas u %02k:%M
33
- yesterday_at_time: Juče u %02k:%M
34
- tomorrow_at_time: Sutra u %02k:%M
35
- on_weekday_at_time: u %A u %02k:%M
36
- on_date_time_current_year: "%-d. %b u %02k:%M"
32
+ today_at_time: "%02k:%M danas"
33
+ yesterday_at_time: "%02k:%M juče"
34
+ tomorrow_at_time: "%02k:%M sutra"
35
+ on_weekday_at_time: "%02k:%M %A"
36
+ on_date_time_current_year: "%02k:%M %-d. %b"
37
37
  on_date: "%-d. %b %Y."
38
- ago: Pre %{time}
38
+ ago: "%{time} ago"
39
39
  x_hours_ago:
40
40
  few: pre %{count} sata
41
41
  one: pre %{count} sata
@@ -130,13 +130,13 @@ sr-Latn:
130
130
  short: "%-d. %b %02k:%M"
131
131
  billing: "%-d.%-m.%Y."
132
132
  yearless_ordinal: "%{ordinalized_day} %B"
133
- today_at_time: Danas u %02k:%M
134
- yesterday_at_time: Juče u %02k:%M
135
- tomorrow_at_time: Sutra u %02k:%M
136
- on_weekday_at_time: u %A u %02k:%M
137
- on_date_time_current_year: "%-d. %b u %02k:%M"
133
+ today_at_time: "%02k:%M danas"
134
+ yesterday_at_time: "%02k:%M juče"
135
+ tomorrow_at_time: "%02k:%M sutra"
136
+ on_weekday_at_time: "%02k:%M %A"
137
+ on_date_time_current_year: "%02k:%M %-d. %b"
138
138
  on_date: "%-d. %b %Y."
139
- ago: Pre %{time}
139
+ ago: "%{time} ago"
140
140
  x_hours_ago:
141
141
  few: pre %{count} sata
142
142
  one: pre %{count} sata
@@ -146,7 +146,7 @@ sr-Latn:
146
146
  one: pre %{count} minuta
147
147
  other: pre %{count} minuta
148
148
  cc_expiry_date: "%m/%Y"
149
- am: pre podne
150
- pm: po podne
151
- just_now: Upravo sada
149
+ am: am
150
+ pm: pm
151
+ just_now: sada
152
152
  yesterday: juče
@@ -29,74 +29,74 @@ sr:
29
29
  default: "%-d.%-m.%Y."
30
30
  billing: "%-d.%-m.%Y."
31
31
  yearless_ordinal: "%{ordinalized_day} %B"
32
- today_at_time: Danas u %02k:%M
33
- yesterday_at_time: Juče u %02k:%M
34
- tomorrow_at_time: Sutra u %02k:%M
35
- on_weekday_at_time: u %A u %02k:%M
36
- on_date_time_current_year: "%-d. %b u %02k:%M"
32
+ today_at_time: "%02k:%M данас"
33
+ yesterday_at_time: "%02k:%M јуче"
34
+ tomorrow_at_time: "%02k:%M сутра"
35
+ on_weekday_at_time: "%02k:%M %A"
36
+ on_date_time_current_year: "%02k:%M %-d. %b"
37
37
  on_date: "%-d. %b %Y."
38
- ago: Pre %{time}
38
+ ago: "%{time} ago"
39
39
  x_hours_ago:
40
- few: pre %{count} sata
41
- one: pre %{count} sata
42
- other: pre %{count} sati
40
+ few: пре %{count} сата
41
+ one: пре %{count} сата
42
+ other: пре %{count} сати
43
43
  x_minutes_ago:
44
- few: pre %{count} minuta
45
- one: pre %{count} minuta
46
- other: pre %{count} minuta
44
+ few: пре %{count} минута
45
+ one: пре %{count} минута
46
+ other: пре %{count} минута
47
47
  cc_expiry_date: "%m/%Y"
48
48
  abbr_day_names:
49
- - ned
50
- - pon
51
- - uto
52
- - sre
53
- - čet
54
- - pet
55
- - sub
49
+ - нед
50
+ - пон
51
+ - уто
52
+ - сре
53
+ - чет
54
+ - пет
55
+ - суб
56
56
  abbr_month_names:
57
57
  - ''
58
- - jan
59
- - feb
60
- - mar
61
- - apr
62
- - maj
63
- - jun
64
- - jul
65
- - avg
66
- - sep
67
- - okt
68
- - nov
69
- - dec
58
+ - јан
59
+ - феб
60
+ - мар
61
+ - апр
62
+ - мај
63
+ - јун
64
+ - јул
65
+ - авг
66
+ - сеп
67
+ - окт
68
+ - нов
69
+ - дец
70
70
  day_names:
71
- - nedelja
72
- - ponedeljak
73
- - utorak
74
- - sreda
75
- - četvrtak
76
- - petak
77
- - subota
71
+ - недеља
72
+ - понедељак
73
+ - уторак
74
+ - среда
75
+ - четвртак
76
+ - петак
77
+ - субота
78
78
  month_names:
79
79
  - ''
80
- - januar
81
- - februar
82
- - mart
83
- - april
84
- - maj
85
- - jun
86
- - jul
87
- - avgust
88
- - septembar
89
- - oktobar
90
- - novembar
91
- - decembar
80
+ - јануар
81
+ - фебруар
82
+ - март
83
+ - април
84
+ - мај
85
+ - јун
86
+ - јул
87
+ - август
88
+ - септембар
89
+ - октобар
90
+ - новембар
91
+ - децембар
92
92
  relative_day_names:
93
- this_week: ove nedelje
94
- this_month: ovog meseca
95
- day_before_yesterday: prekjuče
96
- yesterday: juče
97
- today: danas
98
- tomorrow: sutra
99
- day_after_tomorrow: prekosutra
93
+ this_week: ове недеље
94
+ this_month: овог месеца
95
+ day_before_yesterday: прекјуче
96
+ yesterday: јуче
97
+ today: данас
98
+ tomorrow: сутра
99
+ day_after_tomorrow: прекосутра
100
100
  order:
101
101
  - :day
102
102
  - :month
@@ -130,23 +130,23 @@ sr:
130
130
  short: "%-d. %b %02k:%M"
131
131
  billing: "%-d.%-m.%Y."
132
132
  yearless_ordinal: "%{ordinalized_day} %B"
133
- today_at_time: Danas u %02k:%M
134
- yesterday_at_time: Juče u %02k:%M
135
- tomorrow_at_time: Sutra u %02k:%M
136
- on_weekday_at_time: u %A u %02k:%M
137
- on_date_time_current_year: "%-d. %b u %02k:%M"
133
+ today_at_time: "%02k:%M данас"
134
+ yesterday_at_time: "%02k:%M јуче"
135
+ tomorrow_at_time: "%02k:%M сутра"
136
+ on_weekday_at_time: "%02k:%M %A"
137
+ on_date_time_current_year: "%02k:%M %-d. %b"
138
138
  on_date: "%-d. %b %Y."
139
- ago: Pre %{time}
139
+ ago: "%{time} ago"
140
140
  x_hours_ago:
141
- few: pre %{count} sata
142
- one: pre %{count} sata
143
- other: pre %{count} sati
141
+ few: пре %{count} сата
142
+ one: пре %{count} сата
143
+ other: пре %{count} сати
144
144
  x_minutes_ago:
145
- few: pre %{count} minuta
146
- one: pre %{count} minuta
147
- other: pre %{count} minuta
145
+ few: пре %{count} минута
146
+ one: пре %{count} минута
147
+ other: пре %{count} минута
148
148
  cc_expiry_date: "%m/%Y"
149
- am: pre podne
150
- pm: po podne
151
- just_now: Upravo sada
152
- yesterday: juče
149
+ am: am
150
+ pm: pm
151
+ just_now: сада
152
+ yesterday: јуче
data/data/other/paths.txt CHANGED
@@ -874,7 +874,6 @@
874
874
  /data/other/hand_translated/ru.yml
875
875
  /data/other/hand_translated/sk.yml
876
876
  /data/other/hand_translated/sl.yml
877
- /data/other/hand_translated/sr.yml
878
877
  /data/other/hand_translated/sv.yml
879
878
  /data/other/hand_translated/ta.yml
880
879
  /data/other/hand_translated/te.yml
data/data/regions/BR.yml CHANGED
@@ -28,6 +28,17 @@ format:
28
28
  show: "{firstName} {lastName}_{company}_{address1}_{address2}_{zip} {city} {province}_{country}_{phone}"
29
29
  format_extended:
30
30
  edit: "{country}_{firstName}{lastName}_{company}_{zip}_{streetName}{streetNumber}_{line2}{neighborhood}_{city}{province}_{phone}"
31
+ format_structured:
32
+ edit: "{country}_{firstName}{lastName}_{company}_{zip}_{streetName}{streetNumber}_{line2}{district}_{city}{province}_{phone}"
33
+ show: "{firstName} {lastName}_{company}_{streetName} {streetNumber}_{line2} {district}_{zip} {city} {province}_{country}_{phone}"
34
+ address_line_components:
35
+ - name: streetName
36
+ required: true
37
+ - name: streetNumber
38
+ required: true
39
+ - name: line2
40
+ - name: district
41
+ required: true
31
42
  address1_regex:
32
43
  - "^(?<streetName>.+?),\\s*(?<streetNumber>(?:\\d+[a-zà-öø-ÿ]?|\\d+(?:[-/]\\d+[a-zà-öø-ÿ]?)+|\\d+(?:\\s+\\d+)+|s\\/?n|sem n[úu]mero))$"
33
44
  - "^(?<streetName>.+?),\\s*(?<streetNumber>(?:\\d+[a-zà-öø-ÿ]?|\\d+(?:[-/]\\d+[a-zà-öø-ÿ]?)+|\\d+(?:\\s+\\d+)+|s\\/?n|sem n[úu]mero))\\s*,\\s*(?<line2>.+)$"
data/data/regions/KW.yml CHANGED
@@ -15,6 +15,13 @@ format:
15
15
  show: "{firstName} {lastName}_{company}_{address1}_{address2}_{zip} {city}_{province}_{country}_{phone}"
16
16
  format_extended:
17
17
  edit: "{country}_{firstName}{lastName}_{company}_{address1}_{line2}{neighborhood}_{zip}{city}_{province}_{phone}"
18
+ format_structured:
19
+ edit: "{country}_{firstName}{lastName}_{company}_{address1}_{line2}{district}_{zip}{city}_{province}_{phone}"
20
+ show: "{firstName} {lastName}_{company}_{address1}_{line2} {district}_{zip} {city}_{province}_{country}_{phone}"
21
+ address_line_components:
22
+ - name: line2
23
+ - name: district
24
+ required: true
18
25
  additional_address_fields:
19
26
  - name: line2
20
27
  - name: neighborhood
data/data/regions/PA.yml CHANGED
@@ -19,6 +19,13 @@ format:
19
19
  show: "{firstName} {lastName}_{company}_{address1}_{address2}_{zip} {city}_{province}_{country}_{phone}"
20
20
  format_extended:
21
21
  edit: "{country}_{firstName}{lastName}_{company}_{address1}_{line2}{neighborhood}_{zip}{city}{province}_{phone}"
22
+ format_structured:
23
+ edit: "{country}_{firstName}{lastName}_{company}_{address1}_{line2}{district}_{zip}{city}{province}_{phone}"
24
+ show: "{firstName} {lastName}_{company}_{address1}_{line2} {district}_{zip} {city}_{province}_{country}_{phone}"
25
+ address_line_components:
26
+ - name: line2
27
+ - name: district
28
+ required: true
22
29
  additional_address_fields:
23
30
  - name: line2
24
31
  - name: neighborhood
data/data/regions/PE.yml CHANGED
@@ -16,6 +16,13 @@ format:
16
16
  show: "{firstName} {lastName}_{company}_{address1}_{address2}_{city} {zip}_{province}_{country}_{phone}"
17
17
  format_extended:
18
18
  edit: "{country}_{firstName}{lastName}_{company}_{address1}_{line2}{neighborhood}_{city}{province}{zip}_{phone}"
19
+ format_structured:
20
+ edit: "{country}_{firstName}{lastName}_{company}_{address1}_{line2}{district}_{city}{province}{zip}_{phone}"
21
+ show: "{firstName} {lastName}_{company}_{address1}_{line2} {district}_{city} {zip}_{province}_{country}_{phone}"
22
+ address_line_components:
23
+ - name: line2
24
+ - name: district
25
+ required: true
19
26
  additional_address_fields:
20
27
  - name: line2
21
28
  - name: neighborhood
data/data/regions/PH.yml CHANGED
@@ -18,6 +18,13 @@ format:
18
18
  show: "{firstName} {lastName}_{company}_{address1}_{address2}_{zip} {city}_{province}_{country}_{phone}"
19
19
  format_extended:
20
20
  edit: "{country}_{firstName}{lastName}_{company}_{address1}_{line2}{neighborhood}_{zip}{city}_{province}_{phone}"
21
+ format_structured:
22
+ edit: "{country}_{firstName}{lastName}_{company}_{address1}_{line2}{district}_{zip}{city}_{province}_{phone}"
23
+ show: "{firstName} {lastName}_{company}_{address1}_{line2} {district}_{zip} {city}_{province}_{country}_{phone}"
24
+ address_line_components:
25
+ - name: line2
26
+ - name: district
27
+ required: true
21
28
  additional_address_fields:
22
29
  - name: line2
23
30
  - name: neighborhood
@@ -4,6 +4,14 @@
4
4
 
5
5
  Worldwide defines different address format strings that control the layout of address elements for each country region.
6
6
 
7
+ Each country region can carry up to three sets of format strings:
8
+
9
+ - `format` — the standard layout, built from `address1` / `address2`. Every country has one.
10
+ - `format_extended` — the legacy extended layout (`edit` only), which adds `{streetName}`, `{streetNumber}`, `{line2}` and `{neighborhood}`. Retained for existing consumers; not the vocabulary going forward.
11
+ - `format_structured` — the structured layout (`edit` and `show`), which uses the address line component tokens `{streetName}`, `{streetNumber}`, `{line2}`, `{district}`, `{subdistrict}`. Only countries with a structured layout define it, and the components it uses are declared in that country's `address_line_components`.
12
+
13
+ All three use the same `edit` / `show` syntaxes described below.
14
+
7
15
  Each format string has a different syntax, and is meant for use in different scenarios.
8
16
 
9
17
  This page aims to document these syntaxes, their usage and limitations for those who need to create/edit them.
@@ -109,8 +109,20 @@ module Worldwide
109
109
  # The format is described in https://shopify.engineering/handling-addresses-from-all-around-the-world
110
110
  # - edit: the fields to present on an address input form
111
111
  # - show: how to arrange the fields when formatting an address for display
112
+ #
113
+ # This is the legacy extended layout, retained for existing consumers. It uses the
114
+ # `{neighborhood}` token and pairs with `additional_address_fields` and `combined_address_format`.
115
+ # New consumers should read `format_structured` and `address_line_components` instead.
112
116
  attr_accessor :format_extended
113
117
 
118
+ # Hash of strings denoting how to format a structured address in this region, using the
119
+ # address line component tokens `{streetName}`, `{streetNumber}`, `{line2}`,
120
+ # `{district}` and `{subdistrict}` alongside the standard fields. Empty when the region has no
121
+ # structured layout.
122
+ # - edit: the fields to present on an address input form
123
+ # - show: how to arrange the fields when formatting an address for display
124
+ attr_accessor :format_structured
125
+
114
126
  # The string that results from appending " Countries" to the adjectival form of the {group_name}
115
127
  # @example
116
128
  # Worldwide.region(code: "CA").group == "North American Countries"
@@ -239,9 +251,15 @@ module Worldwide
239
251
  # If true, then the province is optional for addresses in this region.
240
252
  attr_accessor :province_optional
241
253
 
242
- # An array of the additional address fields that are defined for this region
254
+ # An array of the additional address fields that are defined for this region.
255
+ # Legacy counterpart of `address_line_components`; uses the `neighborhood` name.
243
256
  attr_accessor :additional_address_fields
244
257
 
258
+ # An array of the address line components declared for this region, each a Hash with a "name"
259
+ # (one of "streetName", "streetNumber", "line2", "district", "subdistrict")
260
+ # and an optional "required" flag. Empty when the region declares none.
261
+ attr_accessor :address_line_components
262
+
245
263
  # A hash of the rules for concatening the additional address fields into the standard fields
246
264
  attr_accessor :combined_address_format
247
265
 
@@ -284,6 +302,7 @@ module Worldwide
284
302
  @use_zone_code_as_short_name = use_zone_code_as_short_name
285
303
 
286
304
  @additional_address_fields = []
305
+ @address_line_components = []
287
306
  @combined_address_format = {}
288
307
  @address1_regex = []
289
308
  @building_number_required = false
@@ -292,6 +311,7 @@ module Worldwide
292
311
  @flag = nil
293
312
  @format = {}
294
313
  @format_extended = {}
314
+ @format_structured = {}
295
315
  @name_alternates = []
296
316
  @group = nil
297
317
  @group_name = nil
@@ -96,6 +96,7 @@ module Worldwide
96
96
 
97
97
  def apply_territory_attributes(region, spec)
98
98
  region.additional_address_fields = spec["additional_address_fields"] || []
99
+ region.address_line_components = spec["address_line_components"] || []
99
100
  region.combined_address_format = spec["combined_address_format"] || {}
100
101
  region.address1_regex = spec["address1_regex"] || []
101
102
  region.building_number_required = spec["building_number_required"] || false
@@ -106,6 +107,7 @@ module Worldwide
106
107
  region.flag = spec["emoji"]
107
108
  region.format = spec["format"]
108
109
  region.format_extended = spec["format_extended"] || {}
110
+ region.format_structured = spec["format_structured"] || {}
109
111
  region.example_address = spec["example_address"] || nil
110
112
  region.group = spec["group"]
111
113
  region.group_name = spec["group_name"]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Worldwide
4
- VERSION = "1.30.3"
4
+ VERSION = "1.31.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: worldwide
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.30.3
4
+ version: 1.31.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
@@ -3935,21 +3935,8 @@ files:
3935
3935
  - data/cldr/locales/sr-Cyrl-XK/languages.yml
3936
3936
  - data/cldr/locales/sr-Cyrl-XK/plural_rules.yml
3937
3937
  - data/cldr/locales/sr-Cyrl-XK/territories.yml
3938
- - data/cldr/locales/sr-Cyrl/calendars.yml
3939
3938
  - data/cldr/locales/sr-Cyrl/characters.yml
3940
- - data/cldr/locales/sr-Cyrl/currencies.yml
3941
- - data/cldr/locales/sr-Cyrl/delimiters.yml
3942
- - data/cldr/locales/sr-Cyrl/fields.yml
3943
- - data/cldr/locales/sr-Cyrl/languages.yml
3944
- - data/cldr/locales/sr-Cyrl/lists.yml
3945
- - data/cldr/locales/sr-Cyrl/numbers.yml
3946
3939
  - data/cldr/locales/sr-Cyrl/plural_rules.yml
3947
- - data/cldr/locales/sr-Cyrl/plurals.rb
3948
- - data/cldr/locales/sr-Cyrl/rbnf.yml
3949
- - data/cldr/locales/sr-Cyrl/subdivisions.yml
3950
- - data/cldr/locales/sr-Cyrl/territories.yml
3951
- - data/cldr/locales/sr-Cyrl/timezones.yml
3952
- - data/cldr/locales/sr-Cyrl/units.yml
3953
3940
  - data/cldr/locales/sr-Latn-BA/calendars.yml
3954
3941
  - data/cldr/locales/sr-Latn-BA/characters.yml
3955
3942
  - data/cldr/locales/sr-Latn-BA/currencies.yml
@@ -5609,7 +5596,6 @@ files:
5609
5596
  - data/other/hand_translated/ru.yml
5610
5597
  - data/other/hand_translated/sk.yml
5611
5598
  - data/other/hand_translated/sl.yml
5612
- - data/other/hand_translated/sr.yml
5613
5599
  - data/other/hand_translated/sv.yml
5614
5600
  - data/other/hand_translated/ta.yml
5615
5601
  - data/other/hand_translated/te.yml