stable

Clone or download

Read-only

Extract gettext string from .mustache files

Part of request #10790: Use gettext directly in mustache templates To test: 1. In src/templates/homepage/homepage.mustache, add the following: {{# gettext }} new string in homepage {{/ gettext }} Run `make generate-po`. => .pot/.po files of core are updated. Revert the modifications. 2. In plugins/agiledashboard/templates/backlog.mustache, add the following: {{# gettext }} string in core {{/ gettext }} {{# dgettext }} tuleap-agiledashboard | string in domain {{/ dgettext }} Run `make generate-po`. => .pot/.po files of agiledashboard are updated with only "string in domain". .pot/.po files of core are not updated. The same with (d)ngettext. Change-Id: Iea369bf1210e576d563249d317c238ac300fa95d

Modified Files

Name
M src/common/autoload.php +9 −2 Go to diff View file
A src/common/language/Gettext/POTEntry.php +51 −0 Go to diff View file
A src/common/language/Gettext/POTEntryCollection.php +50 −0 Go to diff View file
A src/common/language/Gettext/POTFileDumper.php +53 −0 Go to diff View file
A src/common/templating/mustache/DomainExtractor.php +70 −0 Go to diff View file
A src/common/templating/mustache/GettextCollector.php +74 −0 Go to diff View file
A src/common/templating/mustache/GettextExtractor.php +120 −0 Go to diff View file
M src/common/templating/mustache/GettextHelper.php +15 −11 Go to diff View file
A src/common/templating/mustache/GettextSectionContentTransformer.php +43 −0 Go to diff View file
M src/common/templating/mustache/MustacheEngine.php +5 −5 Go to diff View file
A tests/simpletest/common/language/Gettext/POTEntryCollectionTest.php +53 −0 Go to diff View file
A tests/simpletest/common/language/Gettext/POTFileDumperTest.php +155 −0 Go to diff View file
A tests/simpletest/common/templating/Mustache/DomainExtractorTest.php +91 −0 Go to diff View file
A tests/simpletest/common/templating/Mustache/GettextCollectorTest.php +76 −0 Go to diff View file
A tests/simpletest/common/templating/Mustache/GettextExtractorTest.php +80 −0 Go to diff View file
M tests/simpletest/common/templating/Mustache/GettextHelperTest.php +10 −10 Go to diff View file
A tests/simpletest/common/templating/Mustache/_fixtures/foo/File.php +3 −0 Go to diff View file
A tests/simpletest/common/templating/Mustache/_fixtures/foo/bar/bar.mustache +2 −0 Go to diff View file
A tests/simpletest/common/templating/Mustache/_fixtures/foo/foo.mustache +2 −0 Go to diff View file
M tools/utils/generate-po.php +40 −1 Go to diff View file