DEV Community

tackme
tackme

Posted on • Updated on

Sitecore JSSでウェブサイトのデフォルト言語を日本語にする

以下の方法で日本語化できます。

/data/routes, /data/dictionary内のen.ymlja-JP.ymlにリネーム

/package.jsonlanguageを以下のように修正

  "config": {
    "appName": "myproject",
    "rootPlaceholders": [
      "jss-main"
    ],
    "sitecoreDistPath": "/dist/myproject",
    "sitecoreConfigPath": "/App_Config/Include/zzz",
    "graphQLEndpointPath": "/api/myproject",
-   "language": "en"
+   "language": "ja-JP"
  },
Enter fullscreen mode Exit fullscreen mode

/sitecore/config/{project-name}.configを以下のように修正

 <site patch:before="site[@name='website']"
       inherits="website"
       name="myproject"
       hostName="myproject.dev.local"
       rootPath="/sitecore/content/myproject"
       startItem="/home"
+      language="ja-JP"
       database="master" />
Enter fullscreen mode Exit fullscreen mode

Top comments (0)