The Ultimate Guide to Translating Advanced Custom Fields

翻译高级自定义字段的终极指南

2023-08-23 13:40 Morningside

本文共1012个字,阅读需11分钟

阅读模式 切换至中文

Advanced Custom Fields (ACF) offers a remarkable way to add flexibility and functionality to your WordPress site. By utilizing custom fields, you can include tailored information in your posts, pages, and custom post types, making your website more dynamic. In turn, this enhances the user experience for your site’s visitors. But what happens when you want to take your WordPress site to a global audience? How can you translate these custom fields to match the rest of your site content? That’s where ACF Multilingual (ACFML), an addon plugin from WPML, comes into play. Advanced Custom Fields Multilingual: Making Custom Field Translation Easy If you have a multilingual WordPress site, it only makes sense to also translate the custom field content to communicate with all your site visitors effectively. ACFML extends the capabilities of the WPML plugin, making translating custom fields an intuitive and straightforward process. The addon plugin integrates directly with the ACF interface and lets you: Use the one-step Multilingual Setup to select a preset translation option for your field group Translate everything from custom field values to labels and titles Send fields for translation together with your post content In this guide, we’ll walk you through the entire process of custom field translation. From configuring the translation preferences to sending the custom fields for translation to Morningside, we’ve got you covered. Step 1: Make Sure your Custom Post Types are Translatable The advanced custom fields plugin lets you assign field groups to appear on posts, pages, and custom post types. If you’ve assigned an ACF field group to a post or page, you’re already set. Posts and pages are set to be translatable by default, so you can skip over this step. But what about custom post types? Depending on the theme or plugin, some are translatable by default, others are not. You can check and configure this by going to WPML → Settings and scrolling to the Post Types Translation section. Here, you have two options: Translatable (only show translated items) – Your custom post types are only visible in secondary languages if translations for them exist. Translatable (use translation if available or fallback to the default language) – The translated custom post types will appear in secondary languages if available; otherwise, your site’s visitors will see them in your site’s default language. Step 2: Choose a Translation Option for Your ACF Field Group With ACFML’s setup wizard, choosing a translation option for your custom field groups becomes a breeze. After installing the ACFML add-on, head over to ACF → Field Groups and Edit your field group to set a translation option for it. The ACF Multilingual Setup offers three translation options, but for a simple workflow, it’s best to go with Same fields across languages. This translation option automates the process by setting the translation preferences for each field in your field group for you, letting you quickly move on to sending your content for translation. It assumes that all the content in your default language should appear the same way in your secondary languages. Step 3: Send Your Advanced Custom Fields for Translation Now, all that’s left to do is send your post type for translation. Morningside will receive your post content together with the field group assigned to it 1.Go to WPML → Translation Management. 2. Select the posts you want to translate and the languages you want to translate them into. Then, select the option to Assign to a translator and click on Add to Translation Basket. 3. Review your documents in the Translation Basket. Set a batch name, deadline, and select Morningside as your translation service. Then, click on Send all items for translation. Extra Insights: Keeping Custom Field Translations Up to Date Managing custom field translations after content updates ensures that your visitors get a consistent experience. Whether you’re dealing with translated posts that need updated custom field translations or modifications to field labels, titles, or Choice labels, here’s how to keep everything, including your custom field setup, in sync. Resend Posts for Translation After Updating Custom Field Values If you make changes to any of your custom field values in the default language, you’ll need to resend the post with the assigned field group for translation to Morningside. This includes any changes to your custom field setup, such as background containers or other elements that don’t have translations. For the changes to appear on your translated pages, the content needs to be resent for translation. Update Translations for Modified Field Labels, If you ever modify field labels, titles, or choice labels in your default language, you can easily resend them for translation to Morningside from WPML → String Translation. Why do these need translation? Aren’t they only visible within WordPress? As part of the ACF Interface, and visible when you try to edit a post/page? If there any problem if you don’t keep the translations of these labels up to date? It’s possible to use code to make them appear on the front-end of a website. We noticed users doing this frequently for Choice and Select fields, when they wanted the labels for the options to appear on the front-end. In cases like these, the users wanted to keep the translations up-to-date, as they appear on the front-end. But if a user only keeps them visible within WordPress, it’s not necessary. They probably wouldn’t need them translated at all. You can then head over to Translation Management and follow Step 3 outlined above to send the texts for translation to Morningside. Wrapping Up Creating a multilingual WordPress site enriched with custom fields doesn’t have to be a challenge. With WPML and the ACFML add-on, you can easily make all elements of your site accessible to a global audience. Sending your content to Morningside ensures that your translations are handled with expertise and precision. Together, WPML, ACFML, and Morningside create a streamlined process that supports the integrity of your site’s content in every language.
高级自定义字段(ACF)提供了一种非凡的方式来为您的WordPress网站添加灵活性和功能。通过使用自定义字段,您可以在帖子、页面和自定义帖子类型中包含定制信息,使您的网站更具动态性。反过来,这又增强了您网站访问者的用户体验。 但是当你想把你的WordPress网站推向全球观众时会发生什么呢?如何翻译这些自定义字段以匹配网站的其他内容? 这就是WPML的一个插件ACF Multilingual(ACFML)发挥作用的地方。 高级自定义字段多语言:使自定义字段翻译变得简单 如果你有一个多语言的WordPress网站,那么翻译自定义字段内容以有效地与所有网站访问者进行沟通才有意义。 ACFML扩展了WPML插件的功能,使翻译自定义字段成为一个直观和直接的过程。 插件插件直接与ACF接口集成,并允许您: 使用一步多语言设置为您的字段组选择预设翻译选项 将自定义字段值转换为标签和标题 将需要翻译的字段与您的帖子内容一起发送 在本指南中,我们将引导您完成自定义字段翻译的整个过程。从配置翻译首选项到将翻译的自定义字段发送到Morningside,我们都能为您提供服务。 第1步:确保您的自定义文章类型是可翻译的 高级自定义字段插件允许您分配字段组以显示在帖子、页面和自定义帖子类型上。 如果您已将ACF字段组分配给帖子或页面,则说明您已经设置好了。文章和页面默认设置为可翻译,因此您可以跳过此步骤。 但是自定义文章类型呢?根据主题或插件的不同,有些是默认可翻译的,有些则不是。您可以通过转到WPML →设置并滚动到Post Types Translation部分来检查和配置此设置。在这里,您有两个选择: 可翻译(仅显示翻译的项目)-您的自定义文章类型仅在第二语言中可见,如果它们存在翻译。 可翻译(如果可用,使用翻译或回退到默认语言)-翻译后的自定义帖子类型将以第二语言显示(如果可用);否则,您网站的访问者将以您网站的默认语言看到它们。 步骤2:为ACF字段组选择转换选项 使用ACFML的设置向导,为自定义字段组选择转换选项变得轻而易举。安装ACFML附加组件后,转到ACF → Field Groups并编辑字段组以为其设置转换选项。 ACF多语言设置提供三种翻译选项,但对于简单的工作流程,最好使用跨语言的相同字段。此翻译选项通过为您的字段组中的每个字段设置翻译首选项来自动执行此过程,使您可以快速继续发送要翻译的内容。它假设默认语言中的所有内容在辅助语言中的显示方式都应该相同。 第3步:发送您的高级自定义字段进行翻译 现在,剩下要做的就是发送您的帖子类型进行翻译。晨兴将收到您的帖子内容连同分配给它的字段组 1.转到WPML →翻译管理。 2.选择您要翻译的文章以及要翻译成的语言。然后,选择“Assign to a translator(分配给翻译人员)”选项,并单击“Add to Translation Basket(添加到翻译篮)”。 3.查看翻译篮中的文档。设置批次名称、截止日期,并选择Morningside作为您的翻译服务。然后,单击“Send all items for translation(发送所有要翻译的项目)”。 额外见解:使自定义字段翻译保持最新 在内容更新后管理自定义字段翻译可确保访问者获得一致的体验。无论您是在处理需要更新自定义字段翻译的翻译文章,还是在处理需要修改字段标签、标题或选择标签的翻译文章,这里都介绍了如何保持所有内容(包括自定义字段设置)同步。 更新自定义字段值后重新发送要翻译的帖子 如果您更改了默认语言中的任何自定义字段值,则需要将文章与分配的字段组一起重新发送到Morningside进行翻译。 这包括对自定义字段设置的任何更改,例如背景容器或其他没有转换的元素。要使更改显示在翻译后的页面上,需要重新发送内容以进行翻译。 更新已修改字段标签的翻译, 如果您曾经修改过默认语言的字段标签、标题或选项标签,您可以轻松地将它们重新发送到Morningside,以便从WPML → String Translation进行翻译。 为什么这些需要翻译?它们不是只在WordPress中可见吗?作为ACF接口的一部分,并且在您尝试编辑文章/页面时可见?如果你不保持这些标签的翻译是最新的,会有什么问题吗? 可以使用代码使它们出现在网站的前端。我们注意到用户经常在选择和选择字段中这样做,当他们希望选项的标签出现在前端时。在这种情况下,用户希望保持翻译的最新状态,因为它们出现在前端。但是如果用户只在WordPress中保持它们可见,则没有必要。他们可能根本不需要翻译。 然后,您可以前往翻译管理并按照上述步骤3将翻译文本发送到Morningside。 结束 创建一个多语言的WordPress网站丰富的自定义字段不一定是一个挑战。 使用WPML和ACFML附加组件,您可以轻松地使全球受众都可以访问站点的所有元素。将您的内容发送到晨兴,确保您的翻译得到专业和精确的处理。 WPML、ACFML和Morningside共同创建了一个简化的流程,支持每种语言的网站内容的完整性。

以上中文文本为机器翻译,存在不同程度偏差和错误,请理解并参考英文原文阅读。

阅读原文