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

Command line flags for translations #15

Open
JakobDev opened this issue Oct 20, 2020 · 8 comments
Open

Command line flags for translations #15

JakobDev opened this issue Oct 20, 2020 · 8 comments

Comments

@JakobDev
Copy link

.desktop files can have translated comments and names e.g. comment[de]=Comment. Would be nice, if gendesk supports this.

@xyproto
Copy link
Owner

xyproto commented Oct 28, 2020

Thanks for reporting, I'll add a way to support this.

@xyproto
Copy link
Owner

xyproto commented Jan 18, 2021

I've been giving this some thought.

Adding translation support to gendesk could be implemented in a way that would look a bit like this:

--comment=en:'Real-time synthesizer' --comment=fr:'Synthétiseur temps-réel' --comment=nb:'Sanntids-synthesizer' [etc.]

But when adding translations for many languages, this will easily become an unreasonably long gendesk command.

An alternative is to use the setconf utility to add translations, like this:

setconf -a zynaddsubfx.desktop 'Comment[fr]' 'Synthétiseur temps-réel'

Or just echo, like this:

echo 'Comment[fr]=Synthétiseur temps-réel' >> zynaddsubfx.desktop

Using setconf or echo for translations looks cleaner and easier to me, than adding flags to gendesk. Gendesk can help out in creating .desktop files from scratch, while supplying a minimum of information, but translations are specialized enough that there's not much left for Gendesk to help out with.

What do you think?

@xyproto
Copy link
Owner

xyproto commented Jan 19, 2021

Thinking some more about this, keeping data in a declarative format is better than using commands that do the same.

Keeping translations in a file also makes it easier to keep track of changes if it's checked into a git repository.

I'll add support for reading translations from a .po, json or .toml file.

@JakobDev
Copy link
Author

I use gendesk for creating .desktop files in a PKGBUILd in AUR (example,) so I doesen't need any extra file. I know it's possible to add extra files in AUR. I would prefer to do translations just with arguments. In the most cases there are only a few languages, so the command isn't too long. Maybe it's the best to support translation from commandline and from a file.

@xyproto
Copy link
Owner

xyproto commented Feb 21, 2021

What if there was a translate_desktop tool that could automatically translate from English to a list of languages? Would that be something?

It would be in line with the idea of Gendesk idea of generating a good starting point for a .desktop file, even when little initial information is given.

@JakobDev
Copy link
Author

I would prefer to do this in gendesk, because it's in the repositories of most distributions.

@xyproto
Copy link
Owner

xyproto commented Jun 23, 2021

I see. Would a translation of just the package description usually be enough?

@xyproto xyproto changed the title Allow translation Command line flags for translations Jun 23, 2021
@JakobDev
Copy link
Author

Description and Comment would be enough for me, but I can't speak for other people which may have the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants