-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make-json
: Add new --domain
argument
- Loading branch information
1 parent
bf6720f
commit c8a94d0
Showing
3 changed files
with
47 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -951,3 +951,37 @@ Feature: Split PO files into JSON files. | |
And the return code should be 0 | ||
And the foo-theme/foo-theme-de_DE-557240f2080a0894dbd39f5c2f559bf8.json file should exist | ||
|
||
Scenario: Allows overriding the text domain to use for the file name | ||
Given an empty foo-theme directory | ||
And a foo-theme/de_DE.po file: | ||
""" | ||
# Copyright (C) 2018 Foo Theme | ||
# This file is distributed under the same license as the Foo Plugin package. | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Foo Plugin\n" | ||
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/foo-plugin\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
"Language: de_DE\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"POT-Creation-Date: 2018-05-02T22:06:24+00:00\n" | ||
"PO-Revision-Date: 2018-05-02T22:06:24+00:00\n" | ||
"X-Domain: foo-theme\n" | ||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" | ||
#: foo-theme.js:15 | ||
msgid "Foo Theme" | ||
msgstr "Foo Theme" | ||
""" | ||
|
||
When I run `wp i18n make-json foo-theme --domain=my-custom-domain` | ||
Then STDOUT should contain: | ||
""" | ||
Success: Created 1 file. | ||
""" | ||
And the return code should be 0 | ||
And the foo-theme/my-custom-domain-de_DE-557240f2080a0894dbd39f5c2f559bf8.json file should exist | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters