Skip to content

Commit

Permalink
Merge pull request #465 from bmlt-enabled:handle-default-permalinks-a…
Browse files Browse the repository at this point in the history
…nd-French-translation

Handle-default-permalinks-and-French-translation
  • Loading branch information
otrok7 committed Jan 27, 2024
2 parents 50a9cd5 + 152e4a0 commit 7861349
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 34 deletions.
8 changes: 6 additions & 2 deletions crouton.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Description: A tabbed based display for showing meeting information.
Author: bmlt-enabled
Author URI: https://bmlt.app
Version: 3.18.5
Version: 3.18.6
*/
/* Disallow direct access to the plugin file */
if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) {
Expand Down Expand Up @@ -1162,7 +1162,11 @@ private function getCroutonJsConfig($atts, $croutonMap = false)
$params['extra_meetings'] = $extra_meetings_array;

if (empty($params['meeting_details_href'])) {
$params['meeting_details_href'] = strtok($_SERVER["REQUEST_URI"], '?');
if (empty(get_option('permalink_structure'))) {
$params['meeting_details_href'] = $_SERVER["REQUEST_URI"];
} else {
$params['meeting_details_href'] = strtok($_SERVER["REQUEST_URI"], '?');
}
}
$this->options['meeting_details_href'] = $params['meeting_details_href'];

Expand Down
6 changes: 5 additions & 1 deletion croutonjs/src/js/crouton-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,10 @@ function Crouton(config) {
crouton_Handlebars.registerPartial("meetingLink", self.config['meeting_link_template']);
crouton_Handlebars.registerPartial("meetingModal", self.config['meeting_modal_template']);

let queryStringChar = '?';
if (self.config.meeting_details_href) {
if (self.config.meeting_details_href.indexOf('?') >= 0) queryStringChar = '&';
}
for (var m = 0; m < meetingData.length; m++) {
meetingData[m]['formatted_comments'] = meetingData[m]['comments'];
var duration = meetingData[m]['duration_time'].split(":");
Expand Down Expand Up @@ -826,7 +830,7 @@ function Crouton(config) {
if (meetingData[m]['venue_type'] === 2 && self.config.virtual_meeting_details_href ) {
meetingData[m]['meeting_details_url'] = self.config.virtual_meeting_details_href;
}
meetingData[m]['meeting_details_url'] += ('?meeting-id=' + meetingData[m]['id_bigint']
meetingData[m]['meeting_details_url'] += queryStringChar + ('meeting-id=' + meetingData[m]['id_bigint']
+ '&language=' + self.config.language
+ '&time_format=' + encodeURIComponent(self.config.time_format)
+ (self.config.force_rootserver_in_querystring ? '&root_server=' + encodeURIComponent(self.config.root_server) : '')
Expand Down
60 changes: 30 additions & 30 deletions croutonjs/src/js/crouton-localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function CroutonLocalization(language) {
'toggle fullscreen mode': 'Umschalten Vollbildmodus',
'close': "Schliessen",
'meeting page': "Meeting Seite",
'meeting details': "Genaueres zu Meeting"
'meeting details': "Genaueres zum Meeting"
},
"en-AU": {
"days_of_the_week" : ["", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
Expand Down Expand Up @@ -482,26 +482,26 @@ function CroutonLocalization(language) {
"city" : "Ville",
"cities" : "Villes",
"groups" : "Groupes",
"areas" : "CSL",
"areas" : "ASL",
"regions": "Regions",
"locations" : "Emplacements",
"counties" : "Régions",
"states" : "Provinces",
"postal_codes" : "Codes postaux",
"formats" : "Formats",
"map" : "Carte",
"neighborhood": "Neighborhood",
"near_me": "Near Me",
"text_search": "Text Search",
"click_search": "Click Search",
"pan_and_zoom": "Pan + Zoom",
"languages": "Languages",
"common_needs": "Common Needs",
"meeting_count": "Weekly Meetings:",
"venue_types": "Venue Types",
"neighborhood": "Quartier",
"near_me": "À côté de moi",
"text_search": "Recherche textuelle",
"click_search": "Recherche au clic",
"pan_and_zoom": "Panoramique + Zoom",
"languages": "Langages",
"common_needs": "Besoins",
"meeting_count": "Nombre de réunions par semaine",
"venue_types": "Types de lieux",
"venue_type_choices": {
IN_PERSON: "In Person",
VIRTUAL: "Virtual",
IN_PERSON: "Physique",
VIRTUAL: "Virtuel",
},
"service_body_types": {
AS: "Area Service Committee",
Expand All @@ -511,23 +511,23 @@ function CroutonLocalization(language) {
LS: "Local Service Forum",
GS: "Group Support Forum"
},
"share": "share",
'tabular': "As table",
'google_directions': 'Google directions to meeting',
"no_meetings_for_this_day": "No meetings for this day.",
'css-textalign': '',
'css-floatdirection': '',
'all': 'All',
'menu': "Menu",
'search for meetings': 'Search for meetings',
'show meetings near...': 'Show meetings near...',
'filter meetings': 'Filter meetings',
'visible meeting list': 'Visible meetings as list',
'enter a city or zip code': 'Enter a city or zip code',
'toggle fullscreen mode': 'Toggle fullscreen mode',
'close': "Close",
'meeting page': "Meeting Page",
'meeting details': "Meeting Details"
"share": "Partager",
"tabular": "Liste",
"google_directions": "Itinéraire sur Google Maps",
"no_meetings_for_this_day": "Pas de réunion aujourd'hui.",
"css-textalign": "css-textalign",
"css-floatdirection": "css-floatdirection",
"all": "Tout",
"menu": "Menu",
"search for meetings": "Rechercher des réunions",
"show meetings near...": "Afficher les réunions près de...",
"filter meetings": "Filtrer les réunions",
"visible meeting list": "Liste des réunions visibles",
"enter a city or zip code": "Entrer une ville ou un code postal",
"toggle fullscreen mode": "Basculer en mode plein écran",
"close": "Fermer",
"meeting page": "Page de la réunion",
"meeting details": "Détails de la réunion"
},
"it-IT": {
"days_of_the_week" : ["", "Domenica", " Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"],
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: na, meeting list, meeting finder, maps, recovery, addiction, webservant, b
Requires at least: 4.0
Required PHP: 8.0
Tested up to: 6.4.2
Stable tag: 3.18.5
Stable tag: 3.18.6
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
crouton implements a Tabbed UI for BMLT.
Expand Down Expand Up @@ -36,6 +36,10 @@ https://demo.bmlt.app/crouton

== Changelog ==

= 3.18.6 =
* French translation.
* Correctly handle links when default permalinks are used.

= 3.18.5 =
* Assure croutonMap object created.
* Add meetingCount and groupCount methods for backwards compatibility in non-wordpress cases.
Expand Down

0 comments on commit 7861349

Please sign in to comment.