-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
5 changed files
with
226 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# SOME DESCRIPTIVE TITLE. | ||
# Copyright (C) YEAR ORGANIZATION | ||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"POT-Creation-Date: 2000-01-01 00:00+0000\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Generated-By: pygettext.py 1.5\n" | ||
|
||
|
||
#: custom_keywords.py:9 custom_keywords.py:10 | ||
msgid "bar" | ||
msgstr "" | ||
|
||
#: custom_keywords.py:12 | ||
msgid "cat" | ||
msgid_plural "cats" | ||
msgstr[0] "" | ||
msgstr[1] "" | ||
|
||
#: custom_keywords.py:13 | ||
msgid "dog" | ||
msgid_plural "dogs" | ||
msgstr[0] "" | ||
msgstr[1] "" | ||
|
||
#: custom_keywords.py:15 | ||
msgctxt "context" | ||
msgid "bar" | ||
msgstr "" | ||
|
||
#: custom_keywords.py:17 | ||
msgctxt "context" | ||
msgid "cat" | ||
msgid_plural "cats" | ||
msgstr[0] "" | ||
msgstr[1] "" | ||
|
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from gettext import ( | ||
gettext as foo, | ||
ngettext as nfoo, | ||
pgettext as pfoo, | ||
npgettext as npfoo, | ||
gettext as bar, | ||
) | ||
|
||
foo('bar') | ||
foo('bar', 'baz') | ||
|
||
nfoo('cat', 'cats', 1) | ||
nfoo('dog', 'dogs') | ||
|
||
pfoo('context', 'bar') | ||
|
||
npfoo('context', 'cat', 'cats', 1) | ||
|
||
# This is an unknown keyword and should be ignored | ||
bar('baz') | ||
|
||
# 'nfoo' requires at least 2 arguments | ||
nfoo('dog') | ||
|
||
# 'pfoo' requires at least 2 arguments | ||
pfoo('context') | ||
|
||
# 'npfoo' requires at least 3 arguments | ||
npfoo('context') | ||
npfoo('context', 'cat') |
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
1 change: 1 addition & 0 deletions
1
Misc/NEWS.d/next/Tools-Demos/2025-02-22-18-08-35.gh-issue-130453.njRXG8.rst
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
Extend support for specifying custom keywords in :program:`pygettext`. |
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