Plugin Directory

Changeset 3834211


Ignore:
Timestamp:
11/30/2026 05:22:53 AM (less than one hour ago)
Author:
awcode
Message:

Release 1.1.6: Portuguese (Portugal and Brazil)

Location:
dive-admin/trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • dive-admin/trunk/dive-admin.php

    r3825358 r3834211  
    66 * Plugin URI:        https://diveadmin.com/resources/wordpress
    77 * Description:       DiveAdmin.com is a software solution for diveschools. This plugin connects your website with your account.
    8  * Version:           1.1.5
     8 * Version:           1.1.6
    99 * Requires at least: 6.0
    1010 * Requires PHP:      7.4
    … …  
    2121}
    2222
    23 define( 'DIVE_ADMIN_VERSION', '1.1.5' );
     23define( 'DIVE_ADMIN_VERSION', '1.1.6' );
    2424if ( ! defined( 'DIVE_ADMIN_API_PATH' ) ) {
    2525        // A test site can point at another DiveAdmin by defining this in wp-config.php.
  • dive-admin/trunk/includes/class-dive-admin-i18n.php

    r3716883 r3834211  
    4040                'fil' => 'tl',
    4141                'ar'  => 'ar',
     42                'pt'  => 'pt_PT',
     43        );
     44
     45        /**
     46         * Regional variants with a translation of their own, by WordPress locale (lowercased,
     47         * language_REGION). Takes priority over BUNDLED and APP_CODES: pt_BR is Brazilian
     48         * Portuguese, every other pt locale (pt_PT, pt_AO, pt_PT_ao90, pt) European.
     49         */
     50        const REGIONAL = array(
     51                'pt_br' => array(
     52                        'bundled' => 'pt_BR',
     53                        'app'     => 'pt-BR',
     54                ),
    4255        );
    4356
    … …  
    5669
    5770        /** The languages DiveAdmin is translated into. */
    58         const APP_LANGUAGES = array( 'en', 'de', 'fr', 'es', 'nl', 'it', 'se', 'fi', 'nb', 'dk', 'ru', 'zh', 'th', 'id', 'ph', 'ar' );
     71        const APP_LANGUAGES = array( 'en', 'de', 'fr', 'es', 'nl', 'it', 'se', 'fi', 'nb', 'dk', 'ru', 'zh', 'th', 'id', 'ph', 'ar', 'pt', 'pt-BR' );
    5972
    6073        /**
    … …  
    7992                }
    8093
    81                 $bundled = self::BUNDLED[ self::language( $locale ) ] ?? null;
     94                $regional = self::regional( $locale );
     95                $bundled  = $regional ? $regional['bundled'] : ( self::BUNDLED[ self::language( $locale ) ] ?? null );
    8296                if ( $bundled ) {
    8397                        $file = self::languages_dir() . self::DOMAIN . '-' . $bundled . '.mo';
    … …  
    90104        /**
    91105         * The site's language as a DiveAdmin language code: "fi" for fi / fi_FI, "dk" for
    92          * da_DK, "se" for sv_SE, "ph" for tl / fil. English when DiveAdmin has no translation
    93          * in the site's language.
     106         * da_DK, "se" for sv_SE, "ph" for tl / fil, "pt-BR" for pt_BR and "pt" for other
     107         * Portuguese. English when DiveAdmin has no translation in the site's language.
    94108         */
    95109        public static function app_language( $locale = null ) {
    96                 $language = self::language( $locale ? $locale : determine_locale() );
     110                $locale   = $locale ? $locale : determine_locale();
     111                $regional = self::regional( $locale );
     112                if ( $regional ) {
     113                        return $regional['app'];
     114                }
     115
     116                $language = self::language( $locale );
    97117                $code     = self::APP_CODES[ $language ] ?? $language;
    98118
    … …  
    107127        }
    108128
     129        /** The REGIONAL entry for a locale's language and region ("pt_BR" => Brazilian), if any. */
     130        private static function regional( $locale ) {
     131                $parts = explode( '_', str_replace( '-', '_', strtolower( (string) $locale ) ) );
     132                if ( ! isset( $parts[1] ) ) {
     133                        return null;
     134                }
     135
     136                return self::REGIONAL[ $parts[0] . '_' . $parts[1] ] ?? null;
     137        }
     138
    109139        private static function languages_dir() {
    110140                return plugin_dir_path( dirname( __FILE__ ) ) . 'languages/';
  • dive-admin/trunk/languages/dive-admin.pot

    r3716883 r3834211  
    11msgid ""
    22msgstr ""
    3 "Project-Id-Version: Dive Admin 1.1.3\n"
     3"Project-Id-Version: Dive Admin 1.1.6\n"
    44"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/dive-admin\n"
    55"MIME-Version: 1.0\n"
    … …  
    7575msgid "Book now"
    7676msgstr ""
     77
     78#: admin/class-dive-admin-admin.php
     79msgid "Send to Dive Admin"
     80msgstr ""
     81
     82#: admin/class-dive-admin-admin.php
     83msgid "Dive Admin: %1$d order(s) sent, %2$d refused."
     84msgstr ""
     85
     86#: admin/class-dive-admin-admin.php
     87msgid "Dive Admin did not receive WooCommerce order #%1$s: %2$s. Copy the active WordPress API key from Dive Admin (Settings, Integrations) into the Dive Admin plugin settings, then select the missed orders and use \"Send to Dive Admin\"."
     88msgstr ""
     89
     90#: admin/class-dive-admin-admin.php
     91msgid "Dive Admin settings"
     92msgstr ""
     93
     94#: public/class-dive-admin-public.php
     95msgid "Sent to Dive Admin (lead #%s)."
     96msgstr ""
     97
     98#: public/class-dive-admin-public.php
     99msgid "No answer from Dive Admin"
     100msgstr ""
     101
     102#: public/class-dive-admin-public.php
     103msgid "Not sent to Dive Admin: %s. Check the API key in the Dive Admin plugin settings, then use \"Send to Dive Admin\" in the order actions."
     104msgstr ""
  • dive-admin/trunk/readme.txt

    r3825358 r3834211  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.1.5
     7Stable tag: 1.1.6
    88License: GPLv2
    99
    … …  
    4141== Upgrade Notice ==
    4242
     43    = 1.1.6 =
     44    Portuguese (Portugal and Brazil) translations.
     45
    4346    = 1.1.5 =
    4447    WPML/Polylang orders match products in every language; resend orders to Dive Admin; warnings when orders are refused.
    … …  
    5457
    5558== Changelog ==
     59
     60= 1.1.6 =
     61* Portuguese (Portugal and Brazil): the enquiry form, order actions, notices and order notes are translated, and Portuguese sites send Portuguese to Dive Admin booking pages and enquiries.
    5662
    5763= 1.1.5 =
Note: See TracChangeset for help on using the changeset viewer.