OCA / odoo-pre-commit-hooks

Linters of Odoo addons that complement pylint-odoo
GNU Affero General Public License v3.0
10 stars 12 forks source link

Detect duplicated source reference comments in PO files #25

Closed luisg123v closed 1 year ago

luisg123v commented 2 years ago

We already detect duplicated source terms (msgid), thanks to duplicate-po-message-definition on OCA/pylint-odoo#374 , e.g.:

#. module: mymodule
#: model:ir.model.fields,field_description:mymodule.field_res_partner__salesperson_id
msgid "Internal Salesperson"
msgstr "Vendedor Interno"

#. module: mymodule
#: model:ir.model.fields,field_description:mymodule.field_res_users__salesperson_id
msgid "Internal Salesperson"
msgstr "Vendedor Interno"

However, when msgid's are different but comments are the same, we are not catching such cases:

#. module: mymodule
#: model:ir.model.fields,field_description:mymodule.field_res_partner__salesperson_id
msgid "Internal Salesperson"
msgstr "Vendedor Interno"

#. module: mymodule
#: model:ir.model.fields,field_description:mymodule.field_res_partner__salesperson_id
msgid "Internal Salesperson 2"
msgstr "Vendedor Interno 2"

Even though the latter is syntactically correct regarding PO format, it raises the same error (see OCA/pylint-odoo#289 for the full error message), because it means two terms are trying to translate the same record and field.

Note that this only applies for comments starting with:

# : model:

Other terms like the following ones don't need to be considered, because they don't refer to a specific record:

luisg123v commented 2 years ago

@moylop260 @edy1192 @deivislaya @antonag32

github-actions[bot] commented 1 year ago

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.