Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,29 @@ when an integration's version token still matches, so previously cached personal
output is not reused. Cache duration continues to use
`markdown_alternate_cache_expiration`.

### Contribute translations

The plugin loads translations from `languages/` using the `markdown-alternate`
text domain. Create a translation from `languages/markdown-alternate.pot` in a
gettext editor, then contribute both `markdown-alternate-LOCALE.po` and its
compiled `markdown-alternate-LOCALE.mo` file, for example
`markdown-alternate-nl_NL.po` and `markdown-alternate-nl_NL.mo`.
Keep format placeholders such as `%s` and `%1$d` intact. The template alone does
not translate the plugin; a matching locale file is required.

After changing translatable strings, regenerate the template from the repository
root with WP-CLI:

```bash
wp i18n make-pot . languages/markdown-alternate.pot --slug=markdown-alternate --domain=markdown-alternate --exclude=vendor,tests --skip-js --headers='{"Report-Msgid-Bugs-To":"https://github.com/ProgressPlanner/markdown-alternate/issues"}'
```

Compile a contributed translation with:

```bash
wp i18n make-mo languages/markdown-alternate-nl_NL.po
```

### Run renderer regression tests

Run `php tests/run.php` after installing dependencies. These standalone tests use
Expand Down
93 changes: 93 additions & 0 deletions languages/markdown-alternate.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Copyright (C) 2026 Joost de Valk
# This file is distributed under the GPL-2.0-or-later.
msgid ""
msgstr ""
"Project-Id-Version: Markdown Alternate 1.2.0\n"
"Report-Msgid-Bugs-To: https://github.com/ProgressPlanner/markdown-alternate/issues\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2026-11-25T19:51:04+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.12.0\n"
"X-Domain: markdown-alternate\n"

#. Plugin Name of the plugin
#: markdown-alternate.php
msgid "Markdown Alternate"
msgstr ""

#. Plugin URI of the plugin
#: markdown-alternate.php
msgid "https://github.com/ProgressPlanner/markdown-alternate"
msgstr ""

#. Description of the plugin
#: markdown-alternate.php
msgid "Provides markdown versions of posts and pages via .md URLs"
msgstr ""

#. Author of the plugin
#: markdown-alternate.php
msgid "Joost de Valk"
msgstr ""

#. Author URI of the plugin
#: markdown-alternate.php
msgid "https://joost.blog"
msgstr ""

#: src/Integration/WooCommerce.php:297
msgid "(incl. tax)"
msgstr ""

#: src/Integration/WooCommerce.php:299
msgid "Price:"
msgstr ""

#: src/Integration/WooCommerce.php:302
#: src/Integration/WooCommerce.php:391
msgid "SKU:"
msgstr ""

#: src/Integration/WooCommerce.php:306
msgid "Availability:"
msgstr ""

#: src/Integration/WooCommerce.php:316
msgid "Summary"
msgstr ""

#: src/Integration/WooCommerce.php:320
msgid "Description"
msgstr ""

#: src/Integration/WooCommerce.php:359
msgid "Attributes"
msgstr ""

#. translators: %s: product attribute label, such as Size.
#: src/Integration/WooCommerce.php:378
#, php-format
msgid "Any %s"
msgstr ""

#: src/Integration/WooCommerce.php:395
msgid "Variations"
msgstr ""

#: src/Output/TermRenderer.php:251
msgid "Subcategories"
msgstr ""

#: src/Output/TermRenderer.php:290
msgid "Posts"
msgstr ""

#. translators: 1: number of posts listed, 2: total number of posts, 3: Markdown link to the HTML archive.
#: src/Output/TermRenderer.php:296
#, php-format
msgid "Showing %1$d of %2$d. All of them: %3$s"
msgstr ""
1 change: 1 addition & 0 deletions markdown-alternate.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: markdown-alternate
* Domain Path: /languages
*/

if (!defined('ABSPATH')) {
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ Yes, as an opt-in. With `add_filter( 'markdown_alternate_skip_noindexed', '__ret
== Changelog ==

= Unreleased =
* Added a translation template and loading support for contributed translations.
* Label tax-inclusive displayed product prices and give long product descriptions their own heading.
* Kept author and date archives in HTML instead of redirecting Markdown requests to missing pages
* Fixed cover block images running into the first inner heading
Expand Down
10 changes: 10 additions & 0 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,18 @@ private function __construct() {
);

add_action( 'plugins_loaded', [ $this, 'register_integrations' ] );
add_action( 'init', array( $this, 'load_translations' ) );
}

/**
* Register bundled translations once WordPress has initialized.
*
* @return void
*/
public function load_translations(): void {
load_plugin_textdomain( 'markdown-alternate', false, dirname( plugin_basename( MARKDOWN_ALTERNATE_FILE ) ) . '/languages' );
}

/**
* Register integrations with third-party plugins.
*
Expand Down
Loading