Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

[FEATURE] New providers de_CH, fr_CH, it_CH #739

Merged
merged 8 commits into from
Nov 9, 2015

Conversation

r3h6
Copy link
Contributor

@r3h6 r3h6 commented Oct 16, 2015

This is a very first release of providers for Switzerland.

@r3h6
Copy link
Contributor Author

r3h6 commented Oct 18, 2015

Fixed the error. Now passing unit test on my local development environment.

protected static $postcode = array('####');

protected static $cityNames = array(
'Aarau', 'Aarberg', 'Aarburg', 'Agno', 'Aigle VD', 'Altdorf', 'Altstätten', 'Appenzell', 'Arbon', 'Ascona', 'Aubonne', 'Avenches', 'Baden', 'Bad Zurzach', 'Bâle', 'Bellinzone', 'Berne', 'Beromünster', 'Berthoud', 'Biasca', 'Bienne', 'Bischofszell', 'Boudry', 'Bourg-Saint-Pierre', 'Bremgarten AG', 'Brigue', 'Brugg', 'Bulle', 'Bülach', 'Cerlier', 'Châtel-Saint-Denis', 'Coire', 'Conthey', 'Coppet', 'Cossonay', 'Croglio', 'Cudrefin', 'Cully', 'Delémont', 'Diessenhofen', 'Échallens', 'Eglisau', 'Elgg', 'Estavayer-le-Lac', 'Frauenfeld', 'Fribourg', 'Genève', 'Glaris', 'Gordola', 'Grandcour', 'Grandson', 'Greifensee', 'Grüningen', 'Gruyères', 'Hermance', 'Huttwil', 'Ilanz', 'Kaiserstuhl', 'Klingnau', 'La Chaux-de-Fonds', 'La Neuveville', 'La Sarraz', 'La Tour-de-Peilz', 'La Tour-de-Trême', 'Le Landeron', 'Les Clées', 'Lachen', 'Langenthal', 'Laufon', 'Laufenburg', 'Laupen', 'Lausanne', 'Lenzburg', 'Loèche', 'Lichtensteig', 'Liestal', 'Locarno', 'Losone', 'Lugano', 'Lutry', 'Lucerne', 'Maienfeld', 'Martigny', 'Mellingen', 'Mendrisio', 'Monthey', 'Morat', 'Morcote', 'Morges', 'Moudon', 'Moutier', 'Münchenstein', 'Neuchâtel', 'Neunkirch', 'Nidau', 'Nyon', 'Olten', 'Orbe', 'Orsières', 'Payerne', 'Porrentruy', 'Rapperswil', 'Regensberg', 'Rheinau', 'Rheineck', 'Rheinfelden', 'Riva San Vitale', 'Rolle', 'Romainmôtier', 'Romont FR', 'Rorschach', 'Rue', 'Saillon', 'Saint-Maurice', 'Saint-Prex', 'Saint-Ursanne', 'Sala', 'Saint-Gall', 'Sargans', 'Sarnen', 'Schaffhouse', 'Schwytz', 'Sembrancher', 'Sempach', 'Sion', 'Soleure', 'Splügen', 'Stans', 'Steckborn', 'Stein am Rhein', 'Sursee', 'Thoune', 'Thusis', 'Unterseen', 'Uznach', 'Valangin', 'Vevey', 'Villeneuve', 'Viège', 'Waldenburg', 'Walenstadt', 'Wangen an der Aare', 'Werdenberg', 'Wiedlisbach', 'Wil', 'Willisau', 'Winterthour', 'Yverdon-les-Bains', 'Zofingue', 'Zoug', 'Zurich'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you split this line for easier reading? Also, what's the datasource?

@r3h6
Copy link
Contributor Author

r3h6 commented Oct 20, 2015

Code splitted to lines for easier reading.

Add missing static method for streetPrefix.

I choosed a format with "short" and "name" key for accessing the values more easy for a canton name and short name pair.
Otherwise you must use some sort of array_keys($canton) to get the short name of the pair.
If you like just one of them, then you can use the convenience methods cantonName or cantonShort.

If you prefer the key => value pair, I will change that.

@fzaninotto
Copy link
Owner

For the text providers, please extend the providers from other locales rather than copying them.

'Zdenka', 'Zehra', 'Zenta', 'Zeynep', 'Zita', 'Zofia',
);

protected static $lastName = array(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing datasource

@fzaninotto
Copy link
Owner

yes, please switch to key/value paris for cantons

@r3h6
Copy link
Contributor Author

r3h6 commented Oct 21, 2015

  • Copied providers from other packages now extend these instead of duplicate code.
  • Text provider in package de_CH is still a copy because in Switzerland we don't use the char ß.
  • Lines to long: which package is a good example? Or max 80 chars?

@r3h6
Copy link
Contributor Author

r3h6 commented Nov 8, 2015

Should I do still some changes to the code?

fzaninotto added a commit that referenced this pull request Nov 9, 2015
[FEATURE] New providers de_CH, fr_CH, it_CH
@fzaninotto fzaninotto merged commit cd5fb1c into fzaninotto:master Nov 9, 2015
@r3h6 r3h6 deleted the feature/de_CH branch November 9, 2015 08:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants