Skip to content

Conversation

@MatanzaBR
Copy link

We still need to finish man xbps-install.1 for pt_BR.

xbps-install - pt_BR

* We still need to finish man xbps-install.1 for pt_BR.
@MatanzaBR
Copy link
Author

Screenshot in pt_BR for xbps-install

Captura de tela_2025-09-13_20-53-08 Captura de tela_2025-09-13_19-58-55 Captura de tela_2025-09-13_19-55-56 Captura de tela_2025-09-13_19-55-02 Captura de tela_2025-09-13_19-54-28 Captura de tela_2025-09-13_19-18-17 Captura de tela_2025-09-13_19-17-21 Captura de tela_2025-09-13_19-17-02 Captura de tela_2025-09-13_19-14-00 Captura de tela_2025-09-13_19-13-24 Captura de tela_2025-09-13_19-12-49 Captura de tela_2025-09-13_19-12-11

@MatanzaBR
Copy link
Author

MatanzaBR commented Nov 22, 2025

Example for Brazil:

VoidBR - Void Linux adapted for Brazil

https://plus.diolinux.com.br/t/voidbr-void-linux-adaptado-ao-brasil/76554

@MatanzaBR MatanzaBR closed this by deleting the head repository Nov 24, 2025
@MatanzaBR
Copy link
Author

Although the Void Linux developers reject pull requests related to implementing pt_BR support, the functionality is operational, as demonstrated in the screenshot. It is recommended that the code be reviewed by a larger number of project maintainers, since the same mechanism can be extended to enable additional localizations.

Copy link
Contributor

@meator meator left a comment

Choose a reason for hiding this comment

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

To my knowledge, Void has never really tried to do i18n. If it were to begin now, there would be a lot of resources that would have to be adapted to i18n. I have reviewed your changes, but if I were you, I wouldn't try to fix all of the problems just yet, I would wait for a maintainer to show interest in i18n. Because right now I'm afraid that your changes won't be merged.

This PR doesn't handle the build system side of things. #350, #608 or a PR of equivalent functionality would have to be merged before _()ing all translatable strings and before writing translations.

Your changes are poorly formatted (why so many newlines?) and include non-English comments in code. Both of these things are not desirable.

Your PR only handles xbps-install. I assume it is a proof-of-concept of implementing translations in XBPS. Translations for everything would be preferable if this PR should be merged and released (but see my comment in the first paragraph before embarking on such journey).

My review was quick, I didn't check whether you _()-ed all appropriate strings in xbps-install. A proper transition to gettext would mean sieving through all user strings, adding _(), adding TRANSLATORS comments into appropriate places, sometimes changing the code more to adapt to gettext better or to have nicer input strings (that would later get formatted)...

To do things 100% correctly, code would have to be added to flip the xbps-install summary table in RTL languages. Other more intrusive changes might be also needed in some or all languages.



setlocale(LC_ALL, "");
bindtextdomain("xbps-install", "/usr/share/locale");
Copy link
Contributor

Choose a reason for hiding this comment

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

You shouldn't hardcode paths like that. This would require tighter build system integration, see my other comments on that.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am also not 100% sure on this, but setlocale(LC_ALL, ""); can have unanticipated consequences in a codebase which was locale-unaware before. This could lead to non-English users seeing snippets of translated/localized strings in xbps-install while the rest of the strings remain in English. This can be distracting and it could be considered intrusive to non-English users who are used to English XBPS.

Comment on lines -55 to 66
rv = preset;
else if (response == 'y' || response == 'Y')

// Apenas acrescente S/s como equivalentes
else if (response == 'y' || response == 'Y' || response == 's' || response == 'S')
rv = true;
else if (response == 'n' || response == 'N')
rv = false;
Copy link
Contributor

@meator meator Nov 25, 2025

Choose a reason for hiding this comment

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

This is not acceptable. If you really want to do this, the following might be better:

response = fgetc(stdin);
// TRANSLATORS: The following string isn't displayed to the user, it is used to
//              determine what the user's response to a yes/no question means.
//              The characters in this string should be the same characters
//              as in the TODO string (without the separator, / or otherwise).
//              Only the first character of the user's response is considered,
//              for example, the default English version consideres "y", "ye",
//              "yes" and "yn" the same. You therefore cannot include whole
//              words here.
//              TODO: One letter may occupy multiple bytes. I suspect that the
//              current setup doesn't handle that.
//              This string defines a positive response. See the string below
//              for a negative one.
const char * positive_response = _("yY");
// TRANSLATORS: This string defines a negative response. See the translators
//              comment for positive_response above for more info.
const char * negative_response = _("nN");

if (response == "\n")
	rv = preset;
else if (strchr(positive_response, response) != NULL)
	rt = true;
else if (strchr(negative_response, response) != NULL)
	rt = false;

// ...

Comment on lines +41 to +43
#include <libintl.h>
#include <locale.h>
#define _(STRING) gettext(STRING)
Copy link
Contributor

@meator meator Nov 25, 2025

Choose a reason for hiding this comment

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

This should be put into a common header (without the locale.h header, which should be only needed in main()).

Copy link
Contributor

Choose a reason for hiding this comment

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

Large chunks of this manpage remain in English.

Copy link
Author

Choose a reason for hiding this comment

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

I have restored the fork so that it matches the original Void Linux repository.
Where should we start so that everyone can follow the process?
Should we begin with translating the manual pages for xbps-install and xbps-remove, and then submit separate pull requests for each command?

Copy link
Contributor

Choose a reason for hiding this comment

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

Where should we start?

We should start by taking some time off. By asking the XBPS maintainers to merge this PR, you're indirectly asking them to develop and maintain i18n infrastructure for XBPS. I am not an XBPS maintainer, but I feel that such task would require some work and at least the approval of several XBPS maintainers.

XBPS doesn't receive that much development nowadays (which is great for stability). I consider it a more or less finished project (with a few bugfixes and added flags here and there). Adding such a large feature would require the consensus of several maintainers (in my opinion, which isn't worth much here, since I'm not an XBPS maintainer).

If you haven't already, visit the #xbps channel on Libera.Chat and ask around, you'll get more qualified opinions there.

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.

2 participants