本地化数据库字段中的邮政/实际地址显示

发布于 2024-11-04 09:02:31 字数 498 浏览 0 评论 0原文

谁能向我指出国际邮政/住宅/送货地址格式模板的列表,这些模板使用某种可解析的标准词汇作为地址部分?

理想的列表包含一个国家/地区代码,然后是使用可替换标记的格式,以便我可以将数据库地址字段替换到模板中以生成可本地格式打印的内容。

例如

NZ | [first_name] [family_name]\n[company_name]\n[street_address]\n[city] [post_code]\n[country]
AU | [first_name] [family_name]\n[company_name]\n[street_address]\n[city]\n[state] [post_code]\n[country]
US | etc
UK | etc

背景:我曾经有一个简单的自由文本字段来接受地址。转向支持 vCard 下载,这需要将地址分解为特定字段。没关系:我们可以进行迁移。我正在寻找一种方法来以每个国家/地区的“正确”顺序显示字段。感谢您的帮助!

Can anyone point me to a list of international postal / residential / delivery address format templates that use some kind of parseable standard vocabulary for address parts?

The ideal list contains a country code then a format using replaceable tokens so I can substitute database address fields into a template to produce something printable in the local format.

for example

NZ | [first_name] [family_name]\n[company_name]\n[street_address]\n[city] [post_code]\n[country]
AU | [first_name] [family_name]\n[company_name]\n[street_address]\n[city]\n[state] [post_code]\n[country]
US | etc
UK | etc

Background: I used to have a simple freetext field to accept addresses. Moving to support vCard download, which requires addresses to be broken down into specific fields. Thats all fine: we can do the migration. I'm looking for a way to display the fields in the "correct" order for each country. thanks for your help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

笨死的猪 2024-11-11 09:02:31

此 MSDN 页面 包含您需要的格式的信息,并且看起来很准确,但仅覆盖 33 个国家。也许他们就足够了。

万国邮政联盟提供许多国家/地区所需的所有信息此处。这是高质量的信息;但是,它被分割为多个 PDF 文档,且不符合您需要的格式。

此页面以更易于访问的形式提供信息。据我判断,它是准确的(并且包含很多有价值的信息),但我不能谈论它的质量或它的当前性。

This MSDN page has the information in the format you need and seems accurate, but covers only 33 countries. Maybe they are enough.

The Universal Postal Union offers all the information you need for a lot of countries here. This is top quality information; however, it is split across as many PDF documents as there are countries and is not in the format you need.

This page provides the information in a slightly more accessible form. As far as I can judge, it is accurate (and contains a lot of valuable info), but I can't speak to its quality nor its currentness.

五里雾 2024-11-11 09:02:31

Google 有一个基于 JSON 的 API,用于其包含此类格式信息的 Android 地址输入字段库

您感兴趣的字段是fmt。似乎没有关于他们使用的格式的任何正式文档,但建议包含此信息 作为 Unicode CLDR 的一部分,具有匹配字段(向下滚动至“元素的详细细分”); Google 的 libaddressinput 源代码

Google have a JSON-based API that they use for their Android address input field library that contains this kind of formatting information.

The field you'd be interested in is fmt. There doesn't seem to be any formal documentation on the format they use, but a proposal to include this information as part of the Unicode CLDR has matching fields (scroll down to "Detailed Breakdown of elements"); there are also some clues in Google's libaddressinput source code.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文