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

Support translations in the debug log #169

Open
1 task done
asirota opened this issue Nov 9, 2024 · 15 comments
Open
1 task done

Support translations in the debug log #169

asirota opened this issue Nov 9, 2024 · 15 comments
Labels
i18n Internationalization & Localization needs triage needs to be discussed and worked on

Comments

@asirota
Copy link
Member

asirota commented Nov 9, 2024

I have checked the following:

  • I've searched existing issues and found nothing related to my issue.

Describe the feature you want to add

As far as I know there are no translations in the debug log.

Mockups or Images of the feature

Nothing to add at this time. Would be nice to have debug log messages translated.

@asirota asirota added the i18n Internationalization & Localization label Nov 9, 2024
@namithj
Copy link
Contributor

namithj commented Nov 9, 2024

Lots of translations for debug log related functionality coming up in #168

@asirota asirota added the needs triage needs to be discussed and worked on label Nov 11, 2024
@namithj
Copy link
Contributor

namithj commented Nov 13, 2024

Logs are usually not translated, we can't translate the coding language so why do it for logs.

@asirota
Copy link
Member Author

asirota commented Nov 13, 2024

Aren't there some static strings like message prefixes?

@namithj
Copy link
Contributor

namithj commented Nov 13, 2024

Yes a couple of them like

API rerouted
SSL disabled
etc

Do you think they should be translated?

@asirota
Copy link
Member Author

asirota commented Nov 13, 2024

@afragen what do you think?

@namithj
Copy link
Contributor

namithj commented Nov 13, 2024

Default API Found: %s
SSL Verification Disabled
API Rerouted to: %s

These three are the only ones.

@afragen
Copy link
Contributor

afragen commented Nov 13, 2024

I've never translated error logs.

@asirota
Copy link
Member Author

asirota commented Nov 13, 2024

These are static labels inside the error logs, not the logs themselves.

@afragen
Copy link
Contributor

afragen commented Nov 13, 2024

I've just found most error logs are all English so I didn't see the point of translating labels.

@asirota
Copy link
Member Author

asirota commented Nov 13, 2024

The content most likely is but the labels are static fields which should be translated. Setting a level of completeness here --- the static labels may be other English words eventually that are less technical.

@afragen
Copy link
Contributor

afragen commented Nov 13, 2024

Making them translatable should be fine.

@ipajen
Copy link
Collaborator

ipajen commented Nov 13, 2024

It's important to clearly identify which parts need translation. We should consider whether the value of these new strings justifies the potential barrier they might pose for new contributors in a specific language. Additionally, should the required percentage of translation completion before release be adjusted? An initial check shows over 30 strings needing translation, with these examples. And there are likely many more.

[STRING]: Default API Found:

    [headers] => WpOrg\Requests\Utility\CaseInsensitiveDictionary Object
        (
            [data:protected] => Array
                (
                    [date] => Wed, 13 Nov 2024 19:12:43 GMT
                    [content-type] => application/json; charset=utf-8
                    [server] => Caddy
                    [vary] => Origin
                    [x-powered-by] => PHP/8.3.12
                )

        )

    [body] 

 [response] => Array
        (
            [code] => 200
            [message] => OK
        )

    [cookies] => Array
        (
        )

    [filename] => 
    [http_response] => WP_HTTP_Requests_Response Object
        (
            [data] => 
            [headers] => 
            [status] => 
            [response:protected] => WpOrg\Requests\Response Object

[2024-11-13 19:14:20] [REQUEST]: Array
(
    [method] => POST
    [timeout] => 9
    [redirection] => 5
    [httpversion] => 1.0
    [user-agent] => WordPress/6.7; https://www.mysecretdomain.se
    [reject_unsafe_urls] => 
    [blocking] => 1
    [headers] => Array
        (
        )

    [cookies] => Array
        (
        )

    [body] => Array
        (
            [plugins] =>

Edit by @costdev: Used triple backticks to encompass the example so it's a single code block.

@ipajen
Copy link
Collaborator

ipajen commented Nov 13, 2024

btw we should take input from #polyglots about this

@namithj
Copy link
Contributor

namithj commented Nov 18, 2024

Are we proceeding with this one?

@costdev
Copy link
Contributor

costdev commented Dec 20, 2024

I see the following strings that could be translated:

includes/class-api-rewrite.php

Default API Found:
SSL Verification Disabled
API Rerouted to:

includes/class-debug.php

AspireUpdate - Could not open or write to the file system. Check file system permissions to debug log directory.
STRING
REQUEST
RESPONSE

The rest appear to be array keys, object properties, values, or types like Array or Object, which should not be translated.

Does anyone see any other log-related strings that could/should be translated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n Internationalization & Localization needs triage needs to be discussed and worked on
Projects
None yet
Development

No branches or pull requests

5 participants