aspirepress / aspireupdate

A plugin that allows for rewriting the URLs used to fetch updates from WordPress.org to some other endpoint
GNU General Public License v2.0
29 stars 20 forks source link

Add translation packs to AspireUpdate and more #75

Closed asirota closed 3 days ago

asirota commented 2 weeks ago

Calling all polyglots!

We need several popular languages for AspirePress packages and docs. If you know WordPress translation systems like GlotPress or other solutions to manage translation contributions, we need you.

Read up at translate.WordPress.org and the comments below.

afragen commented 2 weeks ago

It might be worthwhile to create a GlotPress site for this.

afragen commented 2 weeks ago

Also see, https://thefragens.com/translations-updater/

With Git Updater integration it's just another header added to the main plugin file. Allowing for asynchronous translation pack updates without needing to re-issue the primary plugin/repo.

I'm happy to answer questions.

ipajen commented 2 weeks ago

AI generated:

If you’re looking for open-source tools to manage WordPress plugin translations outside the official WordPress.org repository, several alternatives exist that allow you to handle translations and track progress. Here are some popular, open-source solutions:

  1. Poedit

    • Description: A desktop application that lets you edit .po and .mo files, generate .pot files, and track translation progress. • Pros: Simple to use and allows offline editing of translations with progress tracking per file. • Cons: Doesn’t offer version tracking or collaboration tools natively. • Link: Poedit

  2. GlotPress

    • Description: The open-source translation platform that powers translate.wordpress.org. You can install it on your own server to create a self-hosted translation platform. • Pros: Built specifically for WordPress plugins and themes; supports versioned translations and collaborative editing. • Cons: Requires hosting and setup; some features available on translate.wordpress.org might need manual setup. • Link: GlotPress GitHub

  3. Pootle

    • Description: An open-source translation platform with collaborative translation and translation memory features. Supports .po files and multiple translation workflows. • Pros: Supports online collaboration, translation memory, and integration with Git. • Cons: Requires a more complex setup and can be resource-intensive on servers. • Link: Pootle

  4. Weblate

    • Description: A popular open-source, web-based translation management tool. Weblate supports Git integration, making it easier to track translation versions. • Pros: Strong version control, collaborative editing, integration with Git/GitHub, and customizable workflows. • Cons: More complex setup; may require some server resources. • Link: Weblate

  5. Zanata

    • Description: An open-source web-based translation management tool from Red Hat, designed to support collaborative translation. • Pros: Includes collaborative tools, version control, and integration with Git. • Cons: Requires server setup and may be more than necessary for smaller projects. • Link: Zanata

  6. Crowdin CLI (Free for Open Source)

    • Description: Crowdin is typically a paid service, but its CLI tool is open-source and the platform offers free access for open-source projects. • Pros: Powerful toolset, easy-to-use CLI, and GitHub integration for version control. • Cons: May have limitations in the free plan, and setup may be complex. • Link: Crowdin CLI GitHub

  7. GNU Gettext Utilities

    • Description: A suite of tools for managing .po and .mo files, essential for WordPress translations. These tools include commands to generate, merge, and check .po files. • Pros: Lightweight and works well with version control. • Cons: Command-line based; limited to basic .po and .mo management. • Link: GNU Gettext

Summary

If you want a WordPress-like, self-hosted experience, GlotPress is a natural choice. For full-featured, collaborative translation management with versioning, Weblate or Pootle are powerful options, while Poedit is an excellent standalone editor for simpler projects. These tools can help manage translations independently of WordPress.org, offering flexibility in deployment and control.

ipajen commented 2 weeks ago

For inspiration from a random plugin https://translate.cartflows.com/glotpress/projects/cartflows/

ipajen commented 2 weeks ago

AI generated

If you use GlotPress independently (not on WordPress.org) to manage translations for your plugin, you can still distribute translations to your users in a few ways. Here’s how to set up and automate the process so users receive updated translations:

  1. Include Translation Files in Plugin Updates

    • Process: Export the translated .mo files from your self-hosted GlotPress instance for each language, and include these files in your plugin’s /languages folder. • Distribution: When you update your plugin, the translation files are bundled, ensuring users automatically receive the latest translations with each plugin update. • Best For: Plugins updated regularly or when you want full control over distributed translations.

  2. Use an External Hosting Solution for .mo Files

    • Process: Host the compiled .mo files on an external server (e.g., Amazon S3, GitHub, or your own server). In your plugin code, dynamically load these files based on user language settings. • Implementation Example:

function my_plugin_load_textdomain() { $locale = determine_locale(); $mofile = sprintf('https://yourserver.com/translations/my-plugin/%s.mo', $locale); load_textdomain('my-plugin', $mofile); } add_action('plugins_loaded', 'my_plugin_load_textdomain');

•   Distribution: Users fetch the translation files from your server each time they use the plugin.
•   Best For: Plugins with frequent translation updates, where you want users to have the latest version without requiring a plugin update.
  1. Offer a Downloadable .mo File Package

    • Process: Allow users to download a zip file of .mo files from your website or repository. Provide instructions for users to upload these files manually to the /languages folder inside your plugin directory. • Distribution: This method requires users to manually install updated translations. • Best For: Smaller plugins or when users are willing to update translations themselves.

  2. Use GitHub for Translation Distribution (If Plugin is Open Source)

    • Process: Host translation files in a translations folder on GitHub and create a release or tagged version with updated .mo files. Users or developers can download the translations and place them in the appropriate plugin folder. • Distribution: Automate this by providing a GitHub Actions workflow that compiles and exports .mo files each time translations are updated on GlotPress. • Best For: Open-source plugins where users are comfortable with downloading files from GitHub.

  3. Automatically Fetch Updates with a Custom Updater

    • Process: Write a custom updater in your plugin that periodically checks for translation updates from your GlotPress or hosted translations and automatically downloads new .mo files when available. • Implementation Example: • Schedule a daily or weekly cron job to check for new translations and download the latest .mo files. • Distribution: Ensures translations stay up-to-date without requiring users to update the plugin itself. • Best For: Plugins with frequent updates and an established user base.

Summary

The simplest method is to include translations directly in each plugin update, ensuring users automatically receive the latest version. For continuous updates without plugin releases, hosting .mo files externally and having your plugin fetch them as needed can be very effective.

asirota commented 2 weeks ago

Incredible! AI is marvellous in giving advice. However we need a translation lead. Will AI furnish one of those too?

Still looking for a polyglot who wants to lead translations or at least contribute. Thanks!

ipajen commented 2 weeks ago

There is AI translation https://github.com/LibreTranslate/LibreTranslate

For other plugins, who wants to be in AP and not WP repo. How will that be solved for translations Maybe this issue should be at AP level and not AU level ? And then we can use that service from AP?

afragen commented 2 weeks ago

There are distinct benefit to not including the translation files inside the plugin.

asirota commented 2 weeks ago

Not being in worg limits our access to 4,000 translators. That's a shame.

sebastienserre commented 2 weeks ago

I agree with @afragen, a GlotPress instance is the tool we need.

  1. It's easy to use
  2. Polyglot Contributors from wp.org only know how it works => easy and quick onboarding.

Ready to contribute to the French locale (fr_FR)

asirota commented 2 weeks ago

Assuming we have a lot of translation resources to maintain glotpress seems to be the way to go. Anyone up for spinning up a repo to get going there. It's a long term project that can run side by side and be there at the right time when someone needs a translated resource. For now it's just AspireUpdate that has front facing UI. Everything else is server side for now (other than docs of course).

namithj commented 2 weeks ago

I would say let's ship with the translations in the plugin itself for now and think about alternative mechanisms down the road. We shouldn't spread the little resources we have too thin.

asirota commented 1 week ago

We only have Chinese Taiwan so we aren't going to do this until we have a lead.

sebastienserre commented 1 week ago

I think we should create a GlotPress soon because it will help translators to know if new strings are available for translate easily. Currently, we have to pull the project, update the pot file and sync our po file. With a Glotpress and a cron, it would be easier https://www.loom.com/share/411b205aec7142d3afb3fb292254f401 evenif for starting we ship the po extracted from GP to the plugin folder (because it will need some development in ApirePress to load the file automaticaly from GP to the website

fxbenard commented 1 week ago

My 2 cts as co-founder of WP-Translations and TranslationsPress the only WordPress decentralized translation solutions

AI won't do the job for now unfortunately, poor quality and far away from what the translate.wp.org community is doing right now.

afragen commented 1 week ago

If anyone wants to see how decoupled language pack updates work, take a look at https://github.com/afragen/AspireUpdate/tree/decoupled-translations

The translations are maintained here, https://github.com/afragen/aspireupdates-translations

asirota commented 1 week ago

Thanks everyone for the great advice. Seems like there are lots of options out there on how translations are managed. If AspireUpdate has lots more strings that require constant tending to it makes sense to decouple the translations from the plugin code and let them be managed separately outside the plugin. @afragen thanks for your suggestion it looks pretty cool.

A few questions about glotpress:

Is it also a way to decouple translations or is it more of a way to manage translation contributions?

Does glotpress also require decoupling translations and does it provide a mechanism for doing so?

I assume worg has glotpress to manage translate.Wordpress.org - is that website powered by GlotPress?

ipajen commented 1 week ago

@asirota AI answers:

GlotPress is mainly a platform for managing and crowdsourcing translation contributions rather than a strict mechanism for decoupling translations. It allows communities to collaboratively translate projects, like WordPress plugins, themes, and core software, within a web-based interface. Here’s how it aligns with your questions:

  1. Decoupling Translations: GlotPress doesn’t inherently force or require a decoupled translation system. It works as a translation management layer that stores translations, which can then be integrated with projects. However, it does facilitate decoupling in the sense that translations are stored in a standardized format (like .po/.mo files), making it easy to keep translations separate from the main codebase. This structure supports the idea of decoupled translations, although it isn’t designed as a decoupling tool per se.

  2. Translator Management: GlotPress excels as a translation management system. It provides tools for translators, validators, and project admins to contribute, review, and approve translations. With GlotPress, it’s easy to track translation progress and manage language-specific contributions across many contributors.

  3. translate.wordpress.org and GlotPress: Yes, translate.wordpress.org, the official translation platform for WordPress projects, is powered by GlotPress. WordPress.org uses GlotPress to manage translations for core WordPress, themes, plugins, and more, providing a centralized place for translators around the world to contribute translations.

In summary, while GlotPress supports a model where translations can be separated from the codebase, its main focus is on managing contributions, workflow, and collaborative translation efforts rather than acting as a standalone decoupling mechanism.

asirota commented 1 week ago

We should have a ChatGPT bot answering my dumb questions. In the mean time I appreciate you @ipajen very much!

afragen commented 1 week ago

@asirota if you give me some sort of permissions to upload a branch here, I can push my decoupled-translations branch and anyone can easily switch to it using Git Updater.

asirota commented 5 days ago

I'm going to give you write access if you want to project manage translations and work with @toderash as part of the project. LMK.

afragen commented 5 days ago

@asirota that would be great.