xgettext compatibility: Output 'yes' for translatable

This commit is contained in:
Marco Capypara Köpcke 2023-10-30 19:16:45 +01:00 committed by Sonny Piers
parent 85630bc975
commit f1cf70b6eb
13 changed files with 19 additions and 19 deletions

View file

@ -19,7 +19,7 @@ build:
- ninja -C _build docs/en - ninja -C _build docs/en
- git clone https://gitlab.gnome.org/jwestman/blueprint-regression-tests.git - git clone https://gitlab.gnome.org/jwestman/blueprint-regression-tests.git
- cd blueprint-regression-tests - cd blueprint-regression-tests
- git checkout 71522af3607e08143671ee0d224e65e9b9eb9f30 - git checkout 5f9e155c1333e84e6f683cdb26b02a5925fd8db3
- ./test.sh - ./test.sh
- cd .. - cd ..
coverage: '/TOTAL.*\s([.\d]+)%/' coverage: '/TOTAL.*\s([.\d]+)%/'

View file

@ -150,7 +150,7 @@ class XmlOutput(OutputFormat):
elif isinstance(translated, QuotedLiteral): elif isinstance(translated, QuotedLiteral):
return {} return {}
else: else:
return {"translatable": "true", "context": translated.translate_context} return {"translatable": "yes", "context": translated.translate_context}
def _emit_signal(self, signal: Signal, xml: XmlEmitter): def _emit_signal(self, signal: Signal, xml: XmlEmitter):
name = signal.name name = signal.name

View file

@ -8,7 +8,7 @@ corresponding .blp file and regenerate this file with blueprint-compiler.
<requires lib="gtk" version="4.0"/> <requires lib="gtk" version="4.0"/>
<object class="GtkBox"> <object class="GtkBox">
<accessibility> <accessibility>
<property name="label" translatable="true">Hello, world!</property> <property name="label" translatable="yes">Hello, world!</property>
<relation name="labelled-by">my_label</relation> <relation name="labelled-by">my_label</relation>
<state name="checked">1</state> <state name="checked">1</state>
</accessibility> </accessibility>

View file

@ -9,17 +9,17 @@ corresponding .blp file and regenerate this file with blueprint-compiler.
<object class="GtkDialog"> <object class="GtkDialog">
<child type="action"> <child type="action">
<object class="GtkButton" id="cancel_button"> <object class="GtkButton" id="cancel_button">
<property name="label" translatable="true">Cancel</property> <property name="label" translatable="yes">Cancel</property>
</object> </object>
</child> </child>
<child type="action"> <child type="action">
<object class="GtkButton" id="custom_response_button"> <object class="GtkButton" id="custom_response_button">
<property name="label" translatable="true">Reinstall Windows</property> <property name="label" translatable="yes">Reinstall Windows</property>
</object> </object>
</child> </child>
<child type="action"> <child type="action">
<object class="GtkButton" id="ok_button"> <object class="GtkButton" id="ok_button">
<property name="label" translatable="true">Ok</property> <property name="label" translatable="yes">Ok</property>
</object> </object>
</child> </child>
<action-widgets> <action-widgets>
@ -31,7 +31,7 @@ corresponding .blp file and regenerate this file with blueprint-compiler.
<object class="GtkInfoBar"> <object class="GtkInfoBar">
<child type="action"> <child type="action">
<object class="GtkButton" id="ok_info_button"> <object class="GtkButton" id="ok_info_button">
<property name="label" translatable="true">Ok</property> <property name="label" translatable="yes">Ok</property>
</object> </object>
</child> </child>
<action-widgets> <action-widgets>

View file

@ -8,8 +8,8 @@ corresponding .blp file and regenerate this file with blueprint-compiler.
<requires lib="gtk" version="4.0"/> <requires lib="gtk" version="4.0"/>
<object class="AdwAlertDialog"> <object class="AdwAlertDialog">
<responses> <responses>
<response id="cancel" translatable="true">Cancel</response> <response id="cancel" translatable="yes">Cancel</response>
<response id="discard" translatable="true" appearance="destructive">Discard</response> <response id="discard" translatable="yes" appearance="destructive">Discard</response>
<response id="save" enabled="false" appearance="suggested">Save</response> <response id="save" enabled="false" appearance="suggested">Save</response>
</responses> </responses>
</object> </object>

View file

@ -9,7 +9,7 @@ corresponding .blp file and regenerate this file with blueprint-compiler.
<object class="GtkLabel" id="label"></object> <object class="GtkLabel" id="label"></object>
<object class="AdwBreakpoint"> <object class="AdwBreakpoint">
<condition>max-width: 600px</condition> <condition>max-width: 600px</condition>
<setter object="label" property="label" translatable="true">Hello, world!</setter> <setter object="label" property="label" translatable="yes">Hello, world!</setter>
<setter object="label" property="visible">false</setter> <setter object="label" property="visible">false</setter>
<setter object="label" property="extra-menu"></setter> <setter object="label" property="extra-menu"></setter>
</object> </object>

View file

@ -8,8 +8,8 @@ corresponding .blp file and regenerate this file with blueprint-compiler.
<requires lib="gtk" version="4.0"/> <requires lib="gtk" version="4.0"/>
<object class="AdwMessageDialog"> <object class="AdwMessageDialog">
<responses> <responses>
<response id="cancel" translatable="true">Cancel</response> <response id="cancel" translatable="yes">Cancel</response>
<response id="discard" translatable="true" appearance="destructive">Discard</response> <response id="discard" translatable="yes" appearance="destructive">Discard</response>
<response id="save" enabled="false" appearance="suggested">Save</response> <response id="save" enabled="false" appearance="suggested">Save</response>
</responses> </responses>
</object> </object>

View file

@ -9,7 +9,7 @@ corresponding .blp file and regenerate this file with blueprint-compiler.
<object class="GtkComboBoxText"> <object class="GtkComboBoxText">
<items> <items>
<item>Hello, world!</item> <item>Hello, world!</item>
<item translatable="true">Hello!</item> <item translatable="yes">Hello!</item>
<item id="item_id">item</item> <item id="item_id">item</item>
</items> </items>
</object> </object>

View file

@ -8,7 +8,7 @@ corresponding .blp file and regenerate this file with blueprint-compiler.
<requires lib="gtk" version="4.0"/> <requires lib="gtk" version="4.0"/>
<object class="GObject"></object> <object class="GObject"></object>
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label" translatable="true">Test</property> <property name="label" translatable="yes">Test</property>
<property name="visible">false</property> <property name="visible">false</property>
</object> </object>
</interface> </interface>

View file

@ -12,7 +12,7 @@ corresponding .blp file and regenerate this file with blueprint-compiler.
<attribute name="label">test section</attribute> <attribute name="label">test section</attribute>
</section> </section>
<item> <item>
<attribute name="label" translatable="true" context="context">test translated item</attribute> <attribute name="label" translatable="yes" context="context">test translated item</attribute>
</item> </item>
<item> <item>
<attribute name="label">test item shorthand 1</attribute> <attribute name="label">test item shorthand 1</attribute>

View file

@ -9,7 +9,7 @@ corresponding .blp file and regenerate this file with blueprint-compiler.
<object class="GtkScale"> <object class="GtkScale">
<marks> <marks>
<mark value="-1" position="bottom"></mark> <mark value="-1" position="bottom"></mark>
<mark value="0" position="top" translatable="true">Hello, world!</mark> <mark value="0" position="top" translatable="yes">Hello, world!</mark>
<mark value="2"></mark> <mark value="2"></mark>
</marks> </marks>
</object> </object>

View file

@ -9,7 +9,7 @@ corresponding .blp file and regenerate this file with blueprint-compiler.
<object class="GtkStringList" id="greetings"> <object class="GtkStringList" id="greetings">
<items> <items>
<item>Hello, world!</item> <item>Hello, world!</item>
<item translatable="true">Hello!</item> <item translatable="yes">Hello!</item>
</items> </items>
</object> </object>
<object class="GtkDropDown"> <object class="GtkDropDown">

View file

@ -7,9 +7,9 @@ corresponding .blp file and regenerate this file with blueprint-compiler.
<interface> <interface>
<requires lib="gtk" version="4.0"/> <requires lib="gtk" version="4.0"/>
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label" translatable="true">Hello, world!</property> <property name="label" translatable="yes">Hello, world!</property>
</object> </object>
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label" translatable="true" context="translation context">Hello</property> <property name="label" translatable="yes" context="translation context">Hello</property>
</object> </object>
</interface> </interface>