Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve translatable strings. #1903

Open
wants to merge 5 commits into
base: stable
Choose a base branch
from
Open

Conversation

CWehli
Copy link
Contributor

@CWehli CWehli commented Apr 3, 2024

These strings are labeled as "Source needs review" in Weblate.

Copy link
Member

@fellen fellen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good approach, but there is still room for improvements. ;-)

@@ -309,8 +309,8 @@ static const TxnTypeVec short_types
// Translators: this is a stock transaction describing cover
// buying stock, and recording capital gain/loss
N_("Buy to cover short"),
N_("Buy back stock to cover short position, and record capital gain/loss. "
"\n\nIf you are unable to calculate capital gains you can enter a placeholder "
N_("Buy back stock to cover short position, and record capital gain/loss.\n\nIf "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better split the message and keep the layout "\n\n" outside of the translation, e.g.:
printf ("%s\n\n%s", _(para1), _(para2))

@@ -394,8 +394,8 @@ static const TxnTypeVec short_types
// split when shorting stock
N_("Stock split"),
N_("Company issues additional units, thereby reducing the stock price by a divisor, "
"while keeping the total monetary value of the overall investment constant. "
"\n\nIf the split results in a cash in lieu for remainder units, please "
"while keeping the total monetary value of the overall investment constant.\n\nIf "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

gnucash/gtkbuilder/dialog-preferences.glade Outdated Show resolved Hide resolved
@@ -1727,7 +1727,7 @@
<property name="model">imexporter-list</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="tooltip-text" translatable="yes">This list contains the file formats that AQBanking knows how to import. The profile list contains specializations and is populated according to which format you select in this list.</property>
<property name="tooltip-text" translatable="yes">This list contains the file formats that AqBanking knows how to import. The profile list contains specializations and is populated according to which format you select in this list.</property>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we would in a separate "preparing patch for msgmerge" replace all occurrences of "AQBanking" in all .po files using sed. Before grep also the sources.

@@ -191,7 +191,7 @@ gnc_plugin_bi_import_getFilename(GtkWindow *parent)
gtk_file_filter_set_name (filter, "text files (*.txt)");
gtk_file_filter_add_pattern (filter, "*.txt");
filters = g_list_append( filters, filter );
filename = gnc_file_dialog(parent, _("Import Bills or Invoices from csv"), filters, NULL, GNC_FILE_DIALOG_IMPORT);
filename = gnc_file_dialog(parent, _("Import Bills or Invoices from CSV"), filters, NULL, GNC_FILE_DIALOG_IMPORT);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps also a term to grep for.

(set-opt options headingpage2 optname-invoice-number-text (G_ "Invoice #: "))
(set-opt options headingpage2 optname-ref-text (G_ "Reference: "))
(set-opt options headingpage2 optname-jobname-text (G_ "Engagement: "))
(set-opt options headingpage2 optname-invoice-number-text (G_ "Invoice #:"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to insert the space somewhere else?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, i've checked the report and it looks ok for me.

@@ -1335,11 +1335,11 @@ gnc_option_db_book_options(GncOptionDB* odb)
N_("Length of time to change the used invoice report. A value of 0 means disabled."),
0.0, 0.0, 20.0, 1.0);
gnc_register_taxtable_option(odb, business_section,
N_("Default Customer TaxTable"), "f1",
N_("Default Customer Tax Table"), "f1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also a grep candidate.

@CWehli
Copy link
Contributor Author

CWehli commented Apr 15, 2024

Are there any errors in the content of the changes? If not, please accept the PR, as I can't work through the tasks you suggested.
I am not familiar enough with grep to be able to change all files automatically. And the suggestions with printf() would be applied in many places.

@fellen
Copy link
Member

fellen commented Apr 18, 2024

To be done after PR #1895

@CWehli CWehli force-pushed the improve_strings branch 2 times, most recently from 51b7f00 to 22adbb7 Compare April 21, 2024 14:46
@fellen
Copy link
Member

fellen commented May 15, 2024

Very good, but I see still markups in glade files:

grep -inr '&lt;.&gt;' gnucash/gtkbuilder/
gnucash/gtkbuilder/assistant-csv-trans-import.glade:1074:If one of those &lt;i&gt;checks fails&lt;/i&gt; you'll be automatically redirected to the preview page to try and correct.
gnucash/gtkbuilder/assistant-csv-trans-import.glade:1078:If this is your &lt;i&gt;initial import into a new file&lt;/i&gt;, you will first see a dialog for setting book options, since these can affect how imported data are converted to GnuCash transactions. If this is an existing file, the dialog will not be shown.
gnucash/gtkbuilder/assistant-csv-trans-import.glade:1080:If this is the &lt;i&gt;first time importing&lt;/i&gt;, you will find that all lines may need to be associated. On subsequent imports, the importer will try to associate the transactions based on previous imports.
gnucash/gtkbuilder/dialog-new-user.glade:101:                <property name="label" translatable="yes">If you press the &lt;i&gt;Yes&lt;/i&gt; button, the &lt;i&gt;Welcome to GnuCash&lt;/i&gt; dialog will be displayed again next time you start GnuCash. If you press the &lt;i&gt;No&lt;/i&gt; button, it will not be displayed again.</property>
gnucash/gtkbuilder/dialog-new-user.glade:230:                    <property name="label" translatable="yes">There are some predefined actions available that most new users prefer to get started with GnuCash. Select one of these actions from below and click the &lt;i&gt;OK&lt;/i&gt; button or press the &lt;i&gt;Cancel&lt;/i&gt; button if you don't want to perform any of them.</property>
gnucash/gtkbuilder/assistant-hierarchy.glade:542:&lt;b&gt;Note:&lt;/b&gt; all accounts except Equity and placeholder accounts may have an opening balance.</property>

If we can replace the last remaining &lt;b&gt; in
gnucash/gtkbuilder/assistant-hierarchy.glade:542:<b>Note:</b> all accounts except Equity […]
we can patch the po files with sed.
If you are unsure, perhaps @Bob-IT can help you to split this label?

@CWehli
Copy link
Contributor Author

CWehli commented May 16, 2024

@Bob-IT , @fellen
I wonder if ‘Note:’ really needs to be written in bold. Other labels are not formatted either.

@Bob-IT
Copy link
Contributor

Bob-IT commented May 17, 2024

@Bob-IT , @fellen I wonder if ‘Note:’ really needs to be written in bold. Other labels are not formatted either.

I think this one is easy to fix by splitting the text into separate labels like...
0001-assistant-hierarchy.txt

As for the other two files, if you want to remove the markup, I do not think splitting the text is worth while or appropriate. The only thing I can suggest is for the dialog-user, remove all the italics and just put " around the Yes and No text. For csv-trans-import just remove the italics.

@fellen
Copy link
Member

fellen commented May 20, 2024

Seems OK for me, but now someone (I fear I) has to create the preparing patch for the po files.

@jralls
Copy link
Member

jralls commented Jun 16, 2024

@fellen

but now someone has to create the preparing patch for the po files.

I started on that but quickly realized that there are wording changes as well as formatting changes. I can robotically remove the markup and the associated fuzzies but while I can manage to fix the translation of

-"the starting balance.\n"
-"\n"
-"<b>Note:</b> all accounts except Equity and placeholder accounts may have an "
-"opening balance."
+"the starting balance."

in some European languages there's no way I could do so in the languages using non-latin scripts. What do you do in those cases?

@fellen
Copy link
Member

fellen commented Jun 20, 2024

@fellen

but now someone has to create the preparing patch for the po files.

I started on that but quickly realized that there are wording changes as well as formatting changes. I can robotically remove the markup and the associated fuzzies

If you patch the po files before the msgmerge, no new fuzzy flags should be created. That is also the logical error in @cstim's remove-suffix.sh. It would also remove before existing fuzzy flags.

but while I can manage to fix the translation of

-"the starting balance.\n"
-"\n"
-"<b>Note:</b> all accounts except Equity and placeholder accounts may have an "
-"opening balance."
+"the starting balance."

This label was split in 2 or 3. IMHO it is OK to mark them as fuzzy.

in some European languages there's no way I could do so in the languages using non-latin scripts. What do you do in those cases?

I see 2 tasks:

  1. Remove markups: Here it is possible, that we end with duplicate MsgIds, e.g.<b>Note:</b> maps to Note: . That can be checked by a "normal" msgformat -c … and then remove the duplicate.
  2. Append full stops: Ideally in ja and both zh writing it should use instead of ..

@fellen
Copy link
Member

fellen commented Jun 21, 2024

@jralls other patches can map

  • AQBanking and similar forms -> AqBanking in msgid and msgstr
  • csv -> CSV in msgid and msgstr, but not location
  • : " -> :"
    English inaccuracies, msgid only:
  • Summarybar -> Summary Bar
  • TaxTable -> Tax Table

@jralls
Copy link
Member

jralls commented Jun 21, 2024

Largely manual then. Well, that isn't happening by Sunday so I guess these changes get to sit out another cycle.

As for

Append full stops: Ideally in ja and both zh writing it should use 。 instead of ..

Uh-huh. We also have Arabic, Bengali, Cyrillic, Devanagari, Hangul, Hebrew, Kannada, Manipuri, Marathi, Tamil, Telugu, Urdu, and Vietnamese. I guess one can look at existing msgids with full stops and see if there's a corresponding character at the end of the line. Maybe by December.

These strings are labeled as "Source needs review" in Weblate.
as recommended in the GUI-Guidelines for 'Markups in Text' in the wiki.

* Replace markup elements such as &lt;b&gt;
* Change attribute elements
use gnc-class-title instead of &lt;span weight="bold" size="larger"&gt;
and gnc-class-emphasis instead of &lt;span style="italic"&gt;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants