serge-community / serge

Continuous localization platform
https://serge.io/
Other
237 stars 53 forks source link

Generate import report for source language #112

Open icnocop opened 5 years ago

icnocop commented 5 years ago

Hi.

When I run serge import --dry-run for example, a report for the source language is not generated. A report for the destination languages are generated without issues.

source_language             en
destination_languages       zh-Hans zh-Hant fr de it ja ko pt ru es tr
Saving reports:
    serge-import-report-de.html... Done
    serge-import-report-es.html... Done
    serge-import-report-fr.html... Done
    serge-import-report-it.html... Done
    serge-import-report-ja.html... Done
    serge-import-report-ko.html... Done
    serge-import-report-pt.html... Done
    serge-import-report-ru.html... Done
    serge-import-report-tr.html... Done
    serge-import-report-zh-Hans.html... Done
    serge-import-report-zh-Hant.html... Done

Statistics:
---------------    -----    -------    --------    ------
Language           Files    Notices    Warnings    Errors
---------------    -----    -------    --------    ------
source language    17                              401   
de                 17       2680       111         290   
es                 17       2680       111         290   
fr                 17       2680       111         290   
it                 17       2680       111         290   
ja                 17       2680       111         290   
ko                 17       2680       111         290   
pt                 17       2680       111         290   
ru                 17       2680       111         290   
tr                 17       2680       111         290   
zh-Hans            17       2680       111         290   
zh-Hant            17       2680       111         290   
---------------    -----    -------    --------    ------

I expected a report to be generated for the source language so I can more easily read through the errors it reported.

Ex. ERROR: Duplicate key 'MY_DUPLICATE_KEY' found in source file

Thank you.

iafan commented 5 years ago

I expected a report to be generated for the source language so I can more easily read through the errors it reported.

Can you elaborate on that? The purpose of the report is to show the alignment between source and each target language. What would you you expect to see in the report that only shows the source strings?

icnocop commented 5 years ago

When I run the import, the statistics show 401 errors in the source language and a different number of errors in each of the target languages. All the errors in the source language indicate SERGE_ERROR_DUPLICATE_KEY.

That report is different than the report for each of the target languages. For example, the statistics for one of the target languages: SERGE_ERROR_MULTIPLE_TRANSLATIONS | 306 SERGE_WARNING_DUPLICATE_KEY | 96 SERGE_WARNING_UNKNOWN_KEY | 2 SERGE_NOTICE_SAME_TRANSLATION | 550

The fact that the import indicates errors in the source language, generating a report with those errors in one place that can be easily read makes sense to me, especially because they're different than what's reported in each of the target languages.

It seems I should try to resolve the errors and warnings reported in both the source and target languages, before actually doing the import.

icnocop commented 5 years ago

Now with https://github.com/evernote/serge/pull/115:

Saving reports:
        serge-import-report-de.html... Done
        serge-import-report-en.html... Done
        serge-import-report-es.html... Done
        serge-import-report-fr.html... Done
        serge-import-report-it.html... Done
        serge-import-report-ja.html... Done
        serge-import-report-ko.html... Done
        serge-import-report-pt.html... Done
        serge-import-report-ru.html... Done
        serge-import-report-tr.html... Done
        serge-import-report-zh-Hans.html... Done
        serge-import-report-zh-Hant.html... Done

Statistics:
--------------------    -----    -------    --------    ------
Language                Files    Notices    Warnings    Errors
--------------------    -----    -------    --------    ------
de                      17       568        107         296
en (source language)    17                              401
es                      17       550        98          306
fr                      17       544        107         297
it                      17       567        109         296
ja                      15       522        114         291
ko                      15       521        112         290
pt                      15       572        110         296
ru                      15       513        113         292
tr                      15       511        99          304
zh-Hans                 15       518        100         302
zh-Hant                 15       453        100         304
--------------------    -----    -------    --------    ------