Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Spanish address format

未关闭
#219 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
cpp
领域
localization

调研方向

从链接的西班牙地址格式数据开始,检查 libaddressinput 如何处理 %n、可选字段和 admin1 字段。在修改格式之前,确定预期的格式化行为;完成的标准是,无论省份是否存在,西班牙地址都能适当地显示省份。

由索引模型根据 Issue 内容生成。

描述

The address format for Spain is currently as follows:

"fmt":"%N%n%O%n%A%n%Z %C %S"

It looks wrong to me to have the province (%S) separated by a space. Instead, one of the following changes would make most sense:

  1. Put it in parentheses. That appears to be the more idiomatic formatting, but it seems to make it harder to make the province be optional.
  2. Add an optional field fmt_admin1 which, when present, indicates a format to use for the admin1 field if present. Then set fmt_admin1 to "(%S)" for Spain.
  3. Make it a newline (%n) instead of a space. This is a simple fix that libaddressinput supports and that is also supported by the postal service.

Regarding the first point, out in the wild, a well-formatted Spanish address seems to leave out the province if it's obvious. For example, for the city of Barcelona, one would write Barcelona by itself rather than write "Barcelona (Barcelona)". For that reason, it may be problematic to make the format string as simple as "%N%n%O%n%A%n%Z %C (%S)". When the admin1 is not present, the address would end up with empty parentheses.

主要语言
C++
星标
629
派生
109
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

google/libaddressinput 的其他 Issue

查看 google/libaddressinput 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。