Dvlv / BoxBuddyRS

A Graphical Interface for Distrobox
MIT License
210 stars 21 forks source link

Text not translated #97

Closed fonskip closed 1 month ago

fonskip commented 1 month ago

https://github.com/Dvlv/BoxBuddyRS/blob/39212c2d61b3177b9388874bd98e4b104bc933ad/src/main.rs#L866 This text is not translated.

I’m not sure about the correct method to add translation "fields" in the pot file so won’t submit a change for this. But I have submitted a french translation and will update it as soon as the new field is there.

fonskip commented 1 month ago

I will add all the necessary changes in the pull request for my other issue, #95

Dvlv commented 1 month ago

Hello, I have added gettext to this string and regenerated the potfile

fonskip commented 1 month ago

Hello. there are other interesting things to note about the translation :

Dvlv commented 1 month ago

gettext(format!()) should be replaced by gettext!()

Does that make a difference to the output, or is it just shorter to type?

do you think that the status printed by distrobox-list should be translated (as it is shown in the UI) ?

No, that's up to Distrobox itself to translate its own output

fonskip commented 1 month ago

gettext(format!()) should be replaced by gettext!()

Does that make a difference to the output, or is it just shorter to type?

Yes, it makes a difference: gettext did not detect strings inside of format! macros. Also, it allows translators to position the {} at the right place, so it should be preferred over alternatives. For example, it is better to translate "How is {}?" with gettext!("How is {}?", john) rather than just translating "How is" with gettext("How is"), because in most latin languages, the question mark should have a space before: "Comment va {} ?". The first solution allows this change, while the second one does not.