문제

I want to override some language translations in a Silverstripe 3 project.

Googling returned this old post referring to Silverstripe 2.x: http://www.ssbits.com/snippets/2009/overriding-silverstripes-language-files-with-your-own/

I used the same method, updated it to the Silverstripe 3 approach, and created the following folders/ files

# zlang
+- _config.php
+-#lang
  +- en.yml

After a /dev/build and a ?flush=all this has had no effect on changing the text to my translation.

How do I override language translations in Silverstripe 3 without altering the core code?

도움이 되었습니까?

해결책

I worked this out, all I needed to do was add the lang folder to the "project" folder like this:

# mysite
+-# lang
  +- en.yml

en.yml contains:

en:
  ProductForm:
    PRODUCT_ADDED: 'My translation'
    PRODUCT_ADDED_LINK: 'My translation'
    ADD_TO_CART: ''My translation'
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top