-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancing Brazilian Address Formatting #122
Comments
Obrigado! Due to Christmas break it will take a few days to review this |
Merry Christmas and happy holidays! Thank you for your quick reply. No rush, I've been playing around with this and tested it out by modifying Option 3 didn't cause any unexpected errors with old addresses. I just need to understand the policy for adding a new variable, if it's possible. I'll write some tests for the new format and submit a PR for option 3 soon. **Original Text in Portuguese Brazil**Feliz natal, e bom descanso. Agradeço pela rápida resposta. Não tenha pressa, eu já fiz alguns testes enquanto escrevia a issue. Modificando e testando no arquivo A opção 3 não causou erros inesperados com endereços antigos, resta só entender a política para inserir uma nova variável, se é que isso é possível. Mais tarde irei escrever alguns testes para o novo formato e enviar a opção 3 para revisão em uma |
PS: All content was prepared by me. Artificial intelligence was used only as a translation tool. |
including: - Tests for the new formatting, - and addresses of Brasilia - DF
Original Text in Portuguese Brazil
## Melhoria no endereçamento brasileiro.O endereço no Brasil possui os seguintes elementos (marcado onde a implementação atual contempla)
faltando somente atender o
complemento
O
complemento
é incluindo antes do bairro e depois da informação da rua, numero.Para continuar mantendo compatibilidade com o padrão da api atual
Uma solução (rápida) pode ser feita a nível do template:
{{{quarter}}}
, que representaria o "complemento" do endereço (já que oquarter
faz parte do complemento, e das variáveis é a única que se aproxima do conceito de complemento)Existem 3 possibilidades para Adicionar o Complemento
Criar uma nova variável:
Utilizar uma variável existente:
Combinar ambas as opções:
Exemplo Prático
Adicionando uma variável
{{{address_complement}}}
ou{{{complement}}}
Onde,
complement
contém o complemento do endereço (Apt. 201, Bloco B, etc.).o template ficaria assim:
address-formatting/conf/countries/worldwide.yaml#L439C1-L451C1
address-formatting/conf/components.yaml#L101
Utilizar uma variável existente.
Comentado no tópico anterior, poderemos utilizar o
{{{quarter}}}
.o template ficaria assim:
address-formatting/conf/countries/worldwide.yaml#L439C1-L451C1
Combinar ambas as opções:
address-formatting/conf/countries/worldwide.yaml#L439C1-L451C1
address-formatting/conf/components.yaml#L101
Improving Brazilian Address Formatting
Brazilian addresses typically include the following components (marked where the current implementation supports them):
Missing: Address Complement
The
complement
should be placed before the neighborhood and after the street name and number.Maintaining Compatibility with the Current API
A quick solution could be implemented at the template level:
{{{quarter}}}
to represent the address complement (since "quarter" is part of the complement and is the closest existing variable).Three Approaches to Add the Complement
Create a new variable:
Utilize an existing variable:
Combine both options:
Practical Example
Adding a new variable
{{{address_complement}}}
or{{{complement}}}
:Where
complement
contains the address complement (Apt. 201, Block B, etc.).The template would look like this:
address-formatting/conf/countries/worldwide.yaml#L439C1-L451C1
address-formatting/conf/components.yaml#L101
Using an existing variable:
As mentioned earlier, we could use
{{{quarter}}}
.The template would look like this:
address-formatting/conf/countries/worldwide.yaml#L439C1-L451C1
Combining both options:
address-formatting/conf/countries/worldwide.yaml#L439C1-L451C1
address-formatting/conf/components.yaml#L101
The text was updated successfully, but these errors were encountered: