processwire-multi-language — community processwire-multi-language, pwaiworkflow, community, ide skills

v1.0.0

关于此技能

非常适合需要为ProcessWire网站提供多语言支持的Web开发代理。 Multi-language fields, URLs, translation functions, language switching, code i18n, and language packs

webmanufaktur webmanufaktur
[1]
[0]
更新于: 3/10/2026

Killer-Skills Review

Decision support comes first. Repository text comes second.

Reference-Only Page Review Score: 8/11

This page remains useful for operators, but Killer-Skills treats it as reference material instead of a primary organic landing page.

Original recommendation layer Concrete use-case guidance Explicit limitations and caution Quality floor passed for review
Review Score
8/11
Quality Score
60
Canonical Locale
en
Detected Body Locale
en

非常适合需要为ProcessWire网站提供多语言支持的Web开发代理。 Multi-language fields, URLs, translation functions, language switching, code i18n, and language packs

核心价值

赋予代理构建具有多语言字段、语言替代字段和使用`__()`、`_n()`、`_x()`协议的翻译函数的多语言网站的能力,实现无缝的语言切换和国际化(i18n)。

适用 Agent 类型

非常适合需要为ProcessWire网站提供多语言支持的Web开发代理。

赋予的主要能力 · processwire-multi-language

配置多语言URL和页面名称
为用户界面实现语言切换器
为全球受众支持翻译模板代码

! 使用限制与门槛

  • 需要ProcessWire框架
  • 仅限于多语言支持功能

Why this page is reference-only

  • - Current locale does not satisfy the locale-governance contract.

Source Boundary

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

评审后的下一步

先决定动作,再继续看上游仓库材料

Killer-Skills 的主价值不应该停在“帮你打开仓库说明”,而是先帮你判断这项技能是否值得安装、是否应该回到可信集合复核,以及是否已经进入工作流落地阶段。

实验室 Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

常见问题与安装步骤

以下问题与步骤与页面结构化数据保持一致,便于搜索引擎理解页面内容。

? FAQ

processwire-multi-language 是什么?

非常适合需要为ProcessWire网站提供多语言支持的Web开发代理。 Multi-language fields, URLs, translation functions, language switching, code i18n, and language packs

如何安装 processwire-multi-language?

运行命令:npx killer-skills add webmanufaktur/pwaiworkflow。支持 Cursor、Windsurf、VS Code、Claude Code 等 19+ IDE/Agent。

processwire-multi-language 适用于哪些场景?

典型场景包括:配置多语言URL和页面名称、为用户界面实现语言切换器、为全球受众支持翻译模板代码。

processwire-multi-language 支持哪些 IDE 或 Agent?

该技能兼容 Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer。可使用 Killer-Skills CLI 一条命令通用安装。

processwire-multi-language 有哪些限制?

需要ProcessWire框架;仅限于多语言支持功能。

安装步骤

  1. 1. 打开终端

    在你的项目目录中打开终端或命令行。

  2. 2. 执行安装命令

    运行:npx killer-skills add webmanufaktur/pwaiworkflow。CLI 会自动识别 IDE 或 AI Agent 并完成配置。

  3. 3. 开始使用技能

    processwire-multi-language 已启用,可立即在当前项目中调用。

! 参考页模式

此页面仍可作为安装与查阅参考,但 Killer-Skills 不再把它视为主要可索引落地页。请优先阅读上方评审结论,再决定是否继续查看上游仓库说明。

Upstream Repository Material

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

Upstream Source

processwire-multi-language

安装 processwire-multi-language,这是一款面向AI agent workflows and automation的 AI Agent Skill。查看评审结论、使用场景与安装路径。

SKILL.md
Readonly
Upstream Repository Material
The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.
Supporting Evidence

What I Do

I provide comprehensive guidance for ProcessWire multi-language support:

  • Multi-language fields (text, textarea, title)
  • Language-alternate fields
  • Multi-language URLs and page names
  • Code internationalization (i18n)
  • Translation functions (__(), _n(), _x())
  • Language switching
  • Language packs for admin

When to Use Me

Use this skill when:

  • Building multi-language websites
  • Setting up multi-language fields
  • Creating language switchers
  • Translating template code strings
  • Working with language-specific URLs
  • Accessing field values in specific languages

Getting Started

Required Modules

Install from Modules > Language:

ModulePurpose
LanguageSupportBase language support
LanguageSupportFieldsMulti-language fields
LanguageSupportPageNamesMulti-language URLs

Adding Languages

  1. Go to Setup > Languages
  2. Click "Add New"
  3. Enter language name (e.g., "spanish", "german")
  4. Save

Multi-Language Fields

Available Field Types

Field TypeDescription
TextLanguageSingle line text
TextareaLanguageMulti-line text/rich text
PageTitleLanguagePage titles

Converting Existing Fields

  1. Go to Setup > Fields > [your field]
  2. Change Type to multi-language version (e.g., Textarea → TextareaLanguage)
  3. Confirm schema change
  4. Save

Using Multi-Language Fields

php
1// Output uses current user's language automatically 2echo $page->title; // Shows title in user's language 3echo $page->body; // Shows body in user's language 4 5// If language version is empty, default language is used

Getting Specific Language Values

php
1// Save current language 2$savedLanguage = $user->language; 3 4// Switch to French 5$user->language = $languages->get('french'); 6echo $page->body; // French version 7 8// Restore language 9$user->language = $savedLanguage;

Alternative: Using getLanguageValue()

php
1$page->of(false); // Turn off output formatting 2$french = $languages->get('french'); 3$frenchBody = $page->body->getLanguageValue($french);

Setting Language Values

php
1$page->of(false); 2 3// Set for current user's language 4$page->body = "Welcome friends"; 5 6// Set for specific language 7$dutch = $languages->get('dutch'); 8$spanish = $languages->get('spanish'); 9$page->body->setLanguageValue($dutch, "Welkom vrienden"); 10$page->body->setLanguageValue($spanish, "Bienvenidos amigos"); 11 12$page->save();

Language-Alternate Fields

Separate fields that substitute for each other based on language.

Naming Convention

{fieldname}_{languagename}

Examples:

  • body_dutch - Dutch version of body
  • summary_spanish - Spanish version of summary

How It Works

php
1// If user language is Dutch and body_dutch exists: 2echo $page->body; // Returns body_dutch value 3 4// If body_dutch is empty: 5echo $page->body; // Returns default body value 6 7// Direct access always works: 8echo $page->body_dutch; // Always returns Dutch version

Setting Values

php
1$page->of(false); 2$page->body = "Welcome friends"; // Default language 3$page->body_dutch = "Welkom vrienden"; // Dutch 4$page->body_spanish = "Bienvenidos amigos"; // Spanish 5$page->save();

Multi-Language URLs

Setup

  1. Install LanguageSupportPageNames module
  2. Edit homepage > Settings tab
  3. Set URL Name for each language (e.g., "en", "es", "de")
  4. Check "Active" for each language
  5. Save

How It Works

LanguageHomepage URLPage URL
Default//about/
Spanish/es//es/acerca/
German/de//de/uber-uns/

Page Name Translation

Edit any page > Settings tab:

  • Set alternative names for each language
  • If left blank, default name is used
  • Check "Active" to enable language

API Methods

php
1// Get URL in specific language 2$url = $page->localUrl($language); 3 4// Get page name in specific language 5$name = $page->localName($language); 6 7// Get path in specific language 8$path = $page->localPath($language); 9 10// Check if page is viewable in language 11if($page->viewable($language)) { 12 // Page is active in this language 13}

Language Switching

php
1<?php 2$savedLanguage = $user->language; 3 4foreach($languages as $language) { 5 // Skip current language 6 if($language->id == $savedLanguage->id) continue; 7 8 // Skip if page not active in this language 9 if(!$page->viewable($language)) continue; 10 11 // Switch to get language-specific URL 12 $user->language = $language; 13 14 echo "<a href='$page->url'>$language->title</a>"; 15} 16 17// Restore language 18$user->language = $savedLanguage; 19?>

Language Switcher (Select)

php
1<select onchange="window.location=this.value"> 2<?php foreach($languages as $language): ?> 3 <?php if(!$page->viewable($language)) continue; ?> 4 <option 5 value="<?=$page->localUrl($language)?>" 6 <?=$user->language->id == $language->id ? 'selected' : ''?> 7 > 8 <?=$language->title?> 9 </option> 10<?php endforeach; ?> 11</select>

Setting Language Manually

php
1// In _init.php or template 2if($input->get->lang) { 3 $lang = $sanitizer->pageName($input->get->lang); 4 $language = $languages->get($lang); 5 if($language->id) { 6 $user->language = $language; 7 } 8}

Code Internationalization (i18n)

Translate static text in template files.

Translation Functions

FunctionUsage
__('text')Basic translation
_n('single', 'plural', $count)Plurals
_x('text', 'context')Context-specific

Basic Translation

php
1// Outside class (template files) 2echo __('Welcome to our site'); 3 4// Inside class (modules) 5echo $this->_('Welcome to our site');

With Placeholders

php
1// WRONG - variable not translatable 2echo __("Created $count pages"); 3 4// RIGHT - use sprintf 5echo sprintf(__('Created %d pages'), $count); 6 7// Multiple placeholders with argument swapping 8echo sprintf( 9 __('Your city is %1$s, and your zip is %2$s.'), 10 $city, 11 $zipcode 12);

Plurals

php
1echo sprintf( 2 _n('Created %d page', 'Created %d pages', $count), 3 $count 4); 5 6// In class 7echo sprintf( 8 $this->_n('Created %d page', 'Created %d pages', $count), 9 $count 10);

Context

When same word has different meanings:

php
1// As a noun 2echo _x('Comment', 'noun'); 3 4// As a verb 5echo _x('Comment', 'verb'); 6 7// In class 8echo $this->_x('Post', 'noun'); 9echo $this->_x('Post', 'verb');

Comments for Translators

php
1// Comment appears to translator 2echo __('g:i:s a'); // Date format in PHP date() format 3 4// With notes (secondary comment) 5echo __('Welcome Guest'); // Headline // Keep it short

Translation Rules

  1. One line: Function call must be on single line
  2. One pair of quotes: No string concatenation inside function
  3. One call per line: Only one translation function per line
php
1// WRONG 2echo __('Hello ' . 'World'); // Concatenation 3echo __('Hello') . __('World'); // Two calls per line 4 5// RIGHT 6echo __('Hello World'); 7echo __('Hello') . ' ' . 8 __('World'); // Separate lines OK

Translating Template Files

Setup Translation

  1. Go to Setup > Languages > [language]
  2. Click "Translate File"
  3. Select your template file
  4. Enter translations for each string
  5. Save

Finding Translatable Files

ProcessWire scans for __() calls in:

  • /site/templates/*.php
  • Module files
  • Core files

Common Patterns

Multi-Language Navigation

php
1<?php foreach($pages->get('/')->children as $item): ?> 2 <a href="<?=$item->url?>"><?=$item->title?></a> 3<?php endforeach; ?>

Title and URL automatically use current language.

php
1$q = $sanitizer->selectorValue($input->get->q); 2$results = $pages->find("title|body~=$q");

Searches current language AND default language.

Check Language Availability

php
1// Check if content exists in current language 2$french = $languages->get('french'); 3$page->of(false); 4$frenchTitle = $page->title->getLanguageValue($french); 5 6if($frenchTitle) { 7 echo "French version available"; 8}

Redirect to User's Browser Language

php
1// In _init.php (only for homepage) 2if($page->id == 1 && !$session->get('lang_set')) { 3 $browserLang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); 4 $language = $languages->get($browserLang); 5 6 if($language->id && $language->id != $languages->getDefault()->id) { 7 $session->set('lang_set', 1); 8 $session->redirect($page->localUrl($language)); 9 } 10 $session->set('lang_set', 1); 11}

Hreflang Tags for SEO

php
1<head> 2<?php foreach($languages as $language): ?> 3 <?php if(!$page->viewable($language)) continue; ?> 4 <link rel="alternate" 5 hreflang="<?=$language->name?>" 6 href="<?=$page->localHttpUrl($language)?>"> 7<?php endforeach; ?> 8</head>

Language Permissions

Control who can edit which languages.

Available Permissions

PermissionDescription
page-edit-lang-defaultEdit default language
page-edit-lang-[name]Edit specific language
page-edit-lang-noneEdit non-language fields
lang-editAccess language tools

Setup Translator Role

  1. Create permission page-edit-lang-spanish
  2. Create role "translator-spanish"
  3. Assign permissions:
    • page-edit
    • page-edit-lang-spanish
  4. Assign role to templates user should translate

Admin Language Packs

Installing Language Packs

  1. Download language pack from ProcessWire site
  2. Go to Setup > Languages > [language]
  3. Upload pack files
  4. Save

Finding Language Packs

Community language packs available at:

  • ProcessWire modules directory
  • ProcessWire forums

Pitfalls / Gotchas

  1. Output formatting matters: Language substitution only works with output formatting ON. Use getLanguageValue() when OFF.

  2. Empty values fallback: If language value is empty, default language is returned automatically.

  3. URL language detection: With LanguageSupportPageNames, language is auto-detected from URL - no manual setting needed.

  4. Translation function rules:

    • One call per line
    • No string concatenation inside __()
    • Use sprintf for variables
  5. Page active in language: Pages must have "Active" checked for each language in Settings tab.

  6. Searching multi-language fields: Searches match current language OR default language.

  7. Homepage URL: Default language homepage is always /, regardless of name setting.

  8. Module translations: Use $this->_() inside classes for better performance.

  9. Context translations: Use _x() when same text appears multiple times with different meanings.

  10. Language names: Use simple names like "spanish", "german" - they become field suffixes.

相关技能

寻找 processwire-multi-language 的替代方案 (Alternative) 或可搭配使用的同类 community Skill?探索以下相关开源技能。

查看全部

openclaw-release-maintainer

Logo of openclaw
openclaw

Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

333.8k
0
AI

widget-generator

Logo of f
f

为prompts.chat的信息反馈系统生成可定制的插件小部件

149.6k
0
AI

flags

Logo of vercel
vercel

React 框架

138.4k
0
浏览器

pr-review

Logo of pytorch
pytorch

Python中具有强大GPU加速的张量和动态神经网络

98.6k
0
开发者工具