Skip to content

Commit 448ce7a

Browse files
committed
Add text domain and update translation
1 parent d0b78be commit 448ce7a

File tree

4 files changed

+140
-220
lines changed

4 files changed

+140
-220
lines changed

Diff for: inc/Services/Facet_WP.php

+17-7
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function accessible_facetwp_pager_html( $output, $params ): string {
9090
$output .= '<span class="facetwp-pager-label sr-only">' . "$text_page $page $text_of $total_pages</span>";
9191

9292
if ( $page > 1 ) {
93-
$output .= '<a href="#" class="facetwp-page previouspostslink" data-page="' . ( $page - 1 ) . '">Précédent</a>';
93+
$output .= '<a href="#" class="facetwp-page previouspostslink" data-page="' . ( $page - 1 ) . '">' . __( 'Previous', 'framework-textdomain' ) . '</a>';
9494
} else {
9595
$output .= '<span class="facetwp-page previouspostslink" aria-hidden="true" tabindex="-1" style="visibility: hidden"></span>';
9696
}
@@ -107,16 +107,16 @@ public function accessible_facetwp_pager_html( $output, $params ): string {
107107

108108
for ( $i = 2; $i > 0; $i -- ) {
109109
if ( 0 < ( $page - $i ) ) {
110-
$output .= '<a href="#" class="facetwp-page" data-page="' . ( $page - $i ) . '"><span class="sr-only">Page</span> ' . ( $page - $i ) . '</a>';
110+
$output .= '<a href="#" class="facetwp-page" data-page="' . ( $page - $i ) . '"><span class="sr-only">' . __( 'Page', 'framework-textdomain' ) . '</span> ' . ( $page - $i ) . '</a>';
111111
}
112112
}
113113

114114
// Current page
115-
$output .= '<a href="#" class="facetwp-page active" aria-current="true" data-page="' . $page . '"><span class="sr-only">Page courante</span> ' . $page . '</a>';
115+
$output .= '<a href="#" class="facetwp-page active" aria-current="true" data-page="' . $page . '"><span class="sr-only">' . __( 'Current page', 'framework-textdomain' ) . '</span> ' . $page . '</a>';
116116

117117
for ( $i = 1; $i <= 2; $i ++ ) {
118118
if ( $total_pages >= ( $page + $i ) ) {
119-
$output .= '<a href="#" class="facetwp-page" data-page="' . ( $page + $i ) . '"><span class="sr-only">Page</span> ' . ( $page + $i ) . '</a>';
119+
$output .= '<a href="#" class="facetwp-page" data-page="' . ( $page + $i ) . '"><span class="sr-only">' . __( 'Page', 'framework-textdomain' ) . '</span> ' . ( $page + $i ) . '</a>';
120120
}
121121
}
122122

@@ -126,13 +126,13 @@ public function accessible_facetwp_pager_html( $output, $params ): string {
126126

127127
if ( $total_pages > ( $page + 2 ) ) {
128128
$output .= '<a href="#" class="facetwp-page last-page" data-page="' . $total_pages . '">
129-
<span class="sr-only">Dernière page</span>
129+
<span class="sr-only">' . __( 'Last page', 'framework-textdomain' ) . '</span>
130130
<span aria-hidden="true">' . $total_pages . '</span>
131131
</a>';
132132
}
133133

134134
if ( $page < $total_pages && $total_pages > 1 ) {
135-
$output .= '<a href="#" class="facetwp-page nextpostslink" data-page="' . ( $page + 1 ) . '">Suivant</a>';
135+
$output .= '<a href="#" class="facetwp-page nextpostslink" data-page="' . ( $page + 1 ) . '">' . __( 'Next', 'framework-textdomain' ) . '</a>';
136136
} else {
137137
$output .= '<span class="facetwp-page nextpostslink" aria-hidden="true" style="visibility: hidden;" tabindex="-1"></span>';
138138
}
@@ -157,7 +157,17 @@ public function accessible_facetwp_labels( string $html, array $args ): string {
157157
];
158158

159159
if ( ( true === in_array( $args['facet']['type'], $show_label_not_empty, true ) && ! empty( $args['values'] ) ) || false === in_array( $args['facet']['type'], $show_label_not_empty, true ) ) {
160-
$html = sprintf( '<label class="facetwp-label" for="%s">%s</label>%s', esc_attr( $args['facet']['name'] ), esc_html( $args['facet']['label'] ), $html );
160+
$label = $args['facet']['label'];
161+
if ( function_exists( 'facetwp_i18n' ) ) {
162+
$label = facetwp_i18n( $label );
163+
}
164+
165+
$html = sprintf( '<label class="facetwp-label" for="%s">%s</label>%s', esc_attr( $args['facet']['name'] ), esc_html( $label ), $html );
166+
167+
// Add id attribute to per_page select
168+
if ( 'per_page' === $args['facet']['name'] ) {
169+
$html = str_replace( '<select class="facetwp-per-page-select">', '<select class="facetwp-per-page-select" id="per_page">', $html );
170+
}
161171
}
162172

163173
return $html;

Diff for: languages/beapi-frontend-framework.pot

+20-111
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2022 BeAPI
1+
# Copyright (C) 2024 BeAPI
22
# This file is distributed under the .
33
msgid ""
44
msgstr ""
@@ -9,10 +9,10 @@ msgstr ""
99
"MIME-Version: 1.0\n"
1010
"Content-Type: text/plain; charset=UTF-8\n"
1111
"Content-Transfer-Encoding: 8bit\n"
12-
"POT-Creation-Date: 2022-06-30T08:09:55+00:00\n"
12+
"POT-Creation-Date: 2024-03-04T09:37:43+00:00\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14-
"X-Generator: WP-CLI 2.6.0\n"
15-
"X-Domain: beapi-frontend-framework\n"
14+
"X-Generator: WP-CLI 2.9.0\n"
15+
"X-Domain: framework-textdomain\n"
1616

1717
#. Theme Name of the theme
1818
#. Description of the theme
@@ -31,123 +31,32 @@ msgstr ""
3131
msgid "http://www.beapi.fr"
3232
msgstr ""
3333

34-
#: components/blocks/footer.php:4
35-
#: components/blocks/skip-links.php:12
36-
msgid "Footer"
34+
#: inc/Services/Acf.php:55
35+
msgid "This theme can't work without ACF plugin. <a href=\"%s\">Please login to admin</a>, and activate it !"
3736
msgstr ""
3837

39-
#: components/blocks/header.php:4
40-
msgid "Header"
38+
#: inc/Services/Facet_WP.php:93
39+
msgid "Previous"
4140
msgstr ""
4241

43-
#: components/blocks/header.php:14
44-
msgid "Open/Close the menu"
42+
#: inc/Services/Facet_WP.php:110
43+
#: inc/Services/Facet_WP.php:119
44+
msgid "Page"
4545
msgstr ""
4646

47-
#: components/blocks/header.php:17
48-
msgid "Main navigation"
47+
#: inc/Services/Facet_WP.php:115
48+
msgid "Current page"
4949
msgstr ""
5050

51-
#: components/blocks/skip-links.php:4
52-
msgid "Fast access links"
51+
#: inc/Services/Facet_WP.php:129
52+
msgid "Last page"
5353
msgstr ""
5454

55-
#: components/blocks/skip-links.php:6
56-
msgid "Main navigation menu"
55+
#: inc/Services/Facet_WP.php:135
56+
msgid "Next"
5757
msgstr ""
5858

59-
#: components/blocks/skip-links.php:9
60-
#: header.php:26
61-
msgid "Main content"
62-
msgstr ""
63-
64-
#: inc/Helpers/Formatting/Link.php:144
65-
msgid "New window"
66-
msgstr ""
67-
68-
#: inc/Helpers/Formatting/Share.php:53
69-
msgid "Share on Facebook"
70-
msgstr ""
71-
72-
#: inc/Helpers/Formatting/Share.php:64
73-
msgid "Share on Twitter"
74-
msgstr ""
75-
76-
#: inc/Helpers/Formatting/Share.php:75
77-
msgid "Share on Linkedin"
78-
msgstr ""
79-
80-
#: inc/Helpers/Formatting/Share.php:86
81-
msgid "Share on Email"
82-
msgstr ""
83-
84-
#: inc/Helpers/Menu_Walker.php:26
85-
msgid "Toggle menu"
86-
msgstr ""
87-
88-
#: inc/Services/Editor.php:76
89-
msgid "Dark"
90-
msgstr ""
91-
92-
#: inc/Services/Editor.php:81
93-
msgid "Light"
94-
msgstr ""
95-
96-
#: inc/Services/Editor.php:86
97-
msgid "Primary"
98-
msgstr ""
99-
100-
#: inc/Services/Editor.php:91
101-
msgid "Secondary"
102-
msgstr ""
103-
104-
#: inc/Services/Editor.php:102
105-
msgid "Title 6"
106-
msgstr ""
107-
108-
#: inc/Services/Editor.php:108
109-
msgid "Title 5"
110-
msgstr ""
111-
112-
#: inc/Services/Editor.php:114
113-
msgid "Title 4"
114-
msgstr ""
115-
116-
#: inc/Services/Editor.php:120
117-
msgid "Title 3"
118-
msgstr ""
119-
120-
#: inc/Services/Editor.php:126
121-
msgid "Title 2"
122-
msgstr ""
123-
124-
#: inc/Services/Editor.php:132
125-
msgid "Title 1"
126-
msgstr ""
127-
128-
#: inc/Services/Editor_Patterns.php:40
129-
msgid "Common"
130-
msgstr ""
131-
132-
#. translators: %s: file name.
133-
#: inc/Services/Editor_Patterns.php:125
134-
msgid "Could not register file \"%s\" as a block pattern (\"Slug\" field missing)"
135-
msgstr ""
136-
137-
#. translators: %1s: file name; %2s: slug value found.
138-
#: inc/Services/Editor_Patterns.php:138
139-
msgid "Could not register file \"%1$s\" as a block pattern (invalid slug \"%2$s\")"
140-
msgstr ""
141-
142-
#. translators: %1s: file name; %2s: slug value found.
143-
#: inc/Services/Editor_Patterns.php:155
144-
msgid "Could not register file \"%s\" as a block pattern (\"Title\" field missing)"
145-
msgstr ""
146-
147-
#: inc/Services/Menu.php:37
148-
msgid "Main menu"
149-
msgstr ""
150-
151-
#: inc/Services/Menu.php:38
152-
msgid "Footer menu"
59+
#: patterns/media-text.php
60+
msgctxt "Pattern title"
61+
msgid "Media Text"
15362
msgstr ""

Diff for: languages/fr_FR.mo

-1.69 KB
Binary file not shown.

0 commit comments

Comments
 (0)