简体中文の表示設定 / Display settings for Simplified Chinese

Topic summary

ユーザーがLiquidテンプレートで多言語タイトル表示を実装中、日本語と英語は正常に動作するが、簡体中文が日本語表示になる問題が発生。

試した設定:

  • title_zh="产品说明" を使用
  • iso_codeとして zhzh_cn の両方を試行

解決策:
Qcoltdが開発ストアで {{ localization.language.iso_code }} を出力して確認したところ、簡体中文の実際のiso_codeは zh-CN (大文字のCN) であることが判明。

推奨対応:
コード内の条件分岐を zh-CN (大文字) に修正する必要がある。iso_codeの大文字・小文字の違いが原因で条件が一致せず、デフォルトの日本語が表示されていた。

Summarized with AI on November 17. AI used: claude-sonnet-4-5-20250929.

(English below)

下記コードでタイトルを多言語表記設定をしています。

日本語と英語は問題なく表示されておりますが、简体中文が正常に動作せず、日本語表記となっています。

title=“商品説明” title_en=“Product Description” title_zh=“产品说明(中国語)”

iso_codeに問題があるのか、その他に問題あるのか、アドバイスをいただければ幸いです。

※iso_codeはzh_cnも試しました。

I’m using the following code to set up multilingual titles.

Japanese and English titles are displaying correctly, but Simplified Chinese is not working properly and showing the Japanese version.

title=“商品説明” title_en=“Product Description” title_zh=“产品说明(Chinese)”

Is there an issue with the iso_code, or is there any other problem? Any advoce would be appreciated.

*I’v also tried using “zh_cn” as the iso_code.

{%- if section.settings.title != blank -%}
    ### 
      {%- if localization.language.iso_code == 'en' and section.settings.title_en != blank -%}
        {{ section.settings.title_en }}
      {%- elsif localization.language.iso_code == 'zh' and section.settings.title_zh != blank -%}
        {{ section.settings.title_zh }}
      {%- else -%}
        {{ section.settings.title }}
      {%- endif -%}
    
  {%- endif -%}
{% schema %}
  {
    "name": "商品説明",
    "settings": [
      {
        "type" : "text",
        "id"  :  "title",
        "label": "セクションタイトル",
        "default": "商品説明"
      },
      {
        "type" : "text",
        "id"   : "title_en",
        "label": "セクションタイトル(英語)",
        "default": "Product Description"
      },
      {
        "type" : "text",
        "id"   : "title_zh", 
        "label": "セクションタイトル(中国語)",
        "default": "产品说明"
      },

@FABEA

開発ストアにて、実際に、

{{ localization.language.iso_code }}

を出力させて確認したところ、

中国語簡体字の場合は、

zh-CN

が出力されました。

zh-cnはお試しになったとのことですが、cnを大文字にして、

zh-CNもお試しいただくと良いかもしれません。

ご参考まで。

(キュー田辺)