Skip to content

Commit

Permalink
Merge pull request #68 from bmlt-enabled/danish-translation
Browse files Browse the repository at this point in the history
adding danish support
  • Loading branch information
pjaudiomv authored Apr 10, 2019
2 parents 9827ad8 + 6ae0339 commit d576e1d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 15 deletions.
38 changes: 27 additions & 11 deletions bmlt-meeting-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin URI: http://wordpress.org/extend/plugins/bread/
Description: Maintains and generates a PDF Meeting List from BMLT.
Author: odathp, radius314, pjaudiomv, klgrimley, jbraswell
Version: 1.9.5
Version: 1.9.6
*/
/* Disallow direct access to the plugin file */
use Mpdf\Mpdf;
Expand Down Expand Up @@ -206,7 +206,9 @@ function getday( $day, $abbreviate = false, $language = '') {
$data = ($abbreviate ? 'Dim / Sun' : "Dimanche / Sunday");
} elseif ( $language == 'se') {
$data = ($abbreviate ? "Sön" : "Söndag");
}
} elseif ( $language == 'dk') {
$data = ($abbreviate ? "Sø" : "Søndag");
}
} elseif ( $day == 2 ) {
if ( $language == 'en' || $language == 'en' ) {
$data = ($abbreviate ? 'Mon' : "Monday");
Expand All @@ -224,7 +226,9 @@ function getday( $day, $abbreviate = false, $language = '') {
$data = ($abbreviate ? 'Lun / Mon' : "Lundi / Monday");
} elseif ( $language == 'se') {
$data = ($abbreviate ? "Mån" : "Måndag");
}
} elseif ( $language == 'dk') {
$data = ($abbreviate ? "Ma" : "Mandag");
}
} elseif ( $day == 3 ) {
if ( $language == 'en' || $language == 'en' ) {
$data = ($abbreviate ? 'Tue' : "Tuesday");
Expand All @@ -242,7 +246,9 @@ function getday( $day, $abbreviate = false, $language = '') {
$data = ($abbreviate ? 'Mar / Tues' : "Mardi / Tuesday");
} elseif ( $language == 'se') {
$data = ($abbreviate ? "Tis" : "Tisdag");
}
} elseif ( $language == 'dk') {
$data = ($abbreviate ? "Ti" : "Tirsdag");
}
} elseif ( $day == 4 ) {
if ( $language == 'en' || $language == 'en' ) {
$data = ($abbreviate ? 'Wed' : "Wednesday");
Expand All @@ -260,7 +266,9 @@ function getday( $day, $abbreviate = false, $language = '') {
$data = ($abbreviate ? 'Mer / Wed' : "Mercredi / Wednesday");
} elseif ( $language == 'se') {
$data = ($abbreviate ? "Ons" : "Onsdag");
}
} elseif ( $language == 'dk') {
$data = ($abbreviate ? "On" : "Onsdag");
}
} elseif ( $day == 5 ) {
if ( $language == 'en' || $language == 'en' ) {
$data = ($abbreviate ? 'Thu' : "Thursday");
Expand All @@ -278,7 +286,9 @@ function getday( $day, $abbreviate = false, $language = '') {
$data = ($abbreviate ? 'Jeu / Thu' : "Jeudi / Thursday");
} elseif ( $language == 'se') {
$data = ($abbreviate ? "Tors" : "Torsdag");
}
} elseif ( $language == 'dk') {
$data = ($abbreviate ? "To" : "Torsdag");
}
} elseif ( $day == 6 ) {
if ( $language == 'en' || $language == 'en' ) {
$data = ($abbreviate ? 'Fri' : "Friday");
Expand All @@ -296,7 +306,9 @@ function getday( $day, $abbreviate = false, $language = '') {
$data = ($abbreviate ? 'Ven / Fri' : "Vendredi / Friday");
} elseif ( $language == 'se') {
$data = ($abbreviate ? "Fre" : "Fredag");
}
} elseif ( $language == 'dk') {
$data = ($abbreviate ? "Fr" : "Fredag");
}
} elseif ( $day == 7 ) {
if ( $language == 'en' || $language == 'en' ) {
$data = ($abbreviate ? 'Sat' : "Saturday");
Expand All @@ -314,7 +326,9 @@ function getday( $day, $abbreviate = false, $language = '') {
$data = ($abbreviate ? 'Sam / Sat' : "Samedi / Saturday");
} elseif ( $language == 'se') {
$data = ($abbreviate ? "Lör" : "Lördag");
}
} elseif ( $language == 'dk') {
$data = ($abbreviate ? "Lø" : "Lørdag");
}
}

Return utf8_encode($data);
Expand Down Expand Up @@ -1000,9 +1014,11 @@ function bmlt_meeting_list($atts = null, $content = null) {
if ( $this->options['weekday_language'] === 'fr' ) {
$cont = '(suite)';
} else if ( $this->options['weekday_language'] === 'se' ) {
$cont = '(forts)';
} else {
$cont = '(cont)';
$cont = '(forts)';
} else if ( $this->options['weekday_language'] === 'dk' ) {
$cont = '(forts)';
} else {
$cont = '(cont)';
}

if ( $this->options['page_fold'] !== 'full' ) {
Expand Down
5 changes: 3 additions & 2 deletions partials/_meetings_setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,15 @@
</p>
</div>
<?php
$languages = [
$languages = [
"en" => "English",
"fr" => "French",
"po" => "Portuguese",
"both" => "English/Spanish",
"both_po" => "English/Spanish/Portuguese",
"fr_en" => "French/English",
"se" => "Swedish"
"se" => "Swedish",
"dk" => "Danish"
];
?>
<div class="weekday_language_div">
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Contributors: odathp, radius314, pjaudiomv, klgrimley, jbraswell
Tags: meeting list, bmlt, narcotics anonymous, na
Requires at least: 4.0
Requires PHP: 5.6
Tested up to: 5.1
Stable tag: 1.9.5
Tested up to: 5.1.1
Stable tag: 1.9.6
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
A web-based tool that creates, maintains and generates a PDF meeting list from BMLT.
Expand Down Expand Up @@ -54,6 +54,9 @@ Follow all these steps, keep in mind that once you start using bread, it's not g

== Changelog ==

= 1.9.6 =
* Added support for Danish.

= 1.9.5 =
* Removed most TrueType Fonts to cut down size considerably.

Expand Down

0 comments on commit d576e1d

Please sign in to comment.