nnjeim / world

A Laravel package which provides a list of the countries, states, cities, currencies, timezones and languages.
MIT License
761 stars 104 forks source link

Best way #33

Closed slamservice closed 2 years ago

slamservice commented 2 years ago

Hi, I wanted to know which was the best way to:

  1. create the italian translation
  2. add the post code field to the Italian cities Thanks. Marco
nnjeim commented 2 years ago

@slamservice thank you for your input. please look into the following files. response.php

<?php

return [
    'errors' => [
        'server_error' => 'Internal Server Error',
        'record_not_found' => 'No :attribute was found!',
    ],
    'attributes' => [
        'phone' => 'phone|phones',
        'country' => 'country|countries',
        'city' => 'city|cities',
        'state' => 'state|states',
        'timezone' => 'timezone|timezones',
        'currency' => 'currency|currencies',
        'language' => 'language|languages',
    ],
];

this is responsible for the response.

in config: allowed locales you need to at it

the countries names in italian would be available from https://github.com/umpirsky/country-list/blob/master/data/it_IT/country.php

At last regarding the post code fields, i have no idea can you please propose a modification of the schema to allow this addition.

nnjeim commented 2 years ago

@slamservice please consider upgrading to v1.1.15