Jump to content
jmartsch

German (de_DE)

Recommended Posts

Hello guys,

I am the new maintainer of the german language pack. Big thanks to @Nico Knoll and @yellowled for their initial work on the translations.

The language pack is available at https://modules.processwire.com/modules/german/ or in the github repository https://github.com/jmartsch/pw-lang-de

The master branch will (try to) be up to date with the most recent stable version of ProcessWire.
The dev branch will (try to) be up to date with the most recent dev version of ProcessWire.

If you find any missing translations or errors, please create a PR or submit a bug/improvement.

I hope we as a community can work together, to update translatations as soon as a new dev branch is pushed.
Please let me know if you want to translate a new dev version, so we are not both doing the same task.

I will post instructions soon, how you can help.

Then I am able to quickly release an updated stable language pack when a new ProcessWire stable version is released.

  • Like 15
  • Thanks 2

Share this post


Link to post
Share on other sites
17 hours ago, jmartsch said:

I hope we as a community can work together

Happy to assist. I think it would be a good idea to give very clear and easy instructions of how to help. Something like a little tutorial that guides us step by step through the process from finding an un-translated word to creating the PR.

Thanks for taking this project over! 🙂 

  • Like 2

Share this post


Link to post
Share on other sites
On 11/13/2018 at 8:19 AM, jmartsch said:

@Nico Knoll Could you maybe add a link to this post in your original thread?

I've modified that first post with a new update to link here. Let me know if you'd like anything changed.

  • Like 2

Share this post


Link to post
Share on other sites

Just released the language pack for latest dev version 3.0.122, which is also RC2 for the next stable version, so hopefully I can release the new stable language pack as soon as the new stable ProcessWire is released.

Share this post


Link to post
Share on other sites

I am also still working on figuring out, which is the best way how others can easily help translating.

It is not enough to just clone the pw-lang-de repo. You have to have a working ProcessWire installation and install the language pack and then export it again.

Maybe we can have another thread to discuss this. It could act as a base for all language packs.

Share this post


Link to post
Share on other sites

Just released this language pack for the latest master 3.0.123 (only 3 days after release)

  • Like 4
  • Thanks 3

Share this post


Link to post
Share on other sites

just wanted to say thank you @jmartsch I've needed your language pack for several sites in the last weeks and everything works great so far 🙂 

  • Like 1

Share this post


Link to post
Share on other sites

I'm trying to find out, how to translate the english months into german in the frontend. It's from a date field.

I installed the german language pack (core), in the config.php I added setlocale(LC_ALL,'de_DE.UTF-8');

Kopfkratz…

Share this post


Link to post
Share on other sites

@neophron Date formatting can be set directly in the fields settings. It has nothing to do with the german language pack.image.thumb.png.bfa259e0722c8eb6109f96674d236c99.png

  • Like 1

Share this post


Link to post
Share on other sites

Hi @jmartsch

I'm keeping my backend (as an admin) in english, it's better for finding solutions in the community.
 

So, in my config.php I have now this: setlocale(LC_ALL,'en_US.UTF-8, de_DE.UTF-8');

The backend for an editor is german. After my login I'm getting this message in yellow box:

Session: Note: your current server locale setting isn’t working as expected with the UTF-8 charset and may cause minor issues. Your current locale setting is “C”. Please translate the “C” locale setting for each language to the compatible locale in /wire/modules/LanguageSupport/LanguageSupport.module:
• Default
• Deutsch
For example, the locale setting for US English might be: en_US.UTF-8

 

In the backend my setup and the result in the frontend. 
Are there german translation for the months and days?

Bildschirmfoto 2019-01-16 um 13.37.44.jpg

Bildschirmfoto 2019-01-16 um 13.38.33.jpg

Share this post


Link to post
Share on other sites

@neophron

Please open another thread for this, because it has almost nothing to do with the german language pack and is more a general PHP question.

However I will try to give you advice in the right direction.

For locales to work, they have to be existent on the system. You can get a list of all installed locales on Linux if you run `locales -a` in a shell.

The name of a locale depends on the OS and which derivate you are using. So for german for example the locales name could be one of the following:

$loc_de = setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'deu_deu');

or it might even be `de_DE.UTF8`or something else.

@bernhard: strftime is dependent on the locale, so it won't work if the correct locale isn't set.

Here is a little script I wrote that shows you the preferred locale on your system. However, there might be locales missing like in my german example. So please run `locale -a ` in a shell to see whats the correct locale name.

<?php
echo '<h1>test for locales</h1>';

/* try different possible locale names for english GB as of PHP 4.3.0 */
echo '<p>';
$loc_en = setlocale(LC_ALL, 'english_gbr', 'english_britain', 'english_england', 'english_great britain', 'english_uk', 'english_united kingdom', 'english_united-kingdom');
echo "Preferred locale for english GB on this system is '$loc_en'";
echo '<br/>' . strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978));

echo '<p>';
$loc_fr = setlocale(LC_ALL, "fr_FR", "fra", "fr_FR.UTF8", "French_France");
echo "Preferred locale for France on this system is '$loc_fr'";
echo '<br/>' . strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978));


/* try different possible locale names for english USA as of PHP 4.3.0 */
echo '<p>';
$loc_enusa = setlocale(LC_ALL, 'english_usa', 'english_america', 'english_united states', 'english_united-states', 'english_us');
echo "Preferred locale for english USA on this system is '$loc_enusa'";
echo '<br/>' . strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978));

/* try different possible locale names for german as of PHP 4.3.0 */
echo '<p>';
$loc_de = setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'deu_deu');
echo "Preferred locale for german on this system is '$loc_de'";
echo '<br/>' . strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978));

/* try different possible locale names for spanish as of PHP 4.3.0 */
echo '<p>';
$loc_es = setlocale(LC_ALL, 'esp_esp', 'esp_spain', 'spanish_esp', 'spanish_spain');
echo "Preferred locale for spanish on this system is '$loc_es'";
echo '<br/>' . strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978));

/* try different possible locale names for dutch as of PHP 4.3.0 */
echo '<p>';
$loc_nl = setlocale(LC_ALL, 'nld_nld');
echo "Preferred locale for dutch on this system is '$loc_nl'";
echo '<br/>' . strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978));

function smarty_modifier_number_format( $string, $decimals = 2 )
{
	$locale = localeconv();
	// setlocale( LC_NUMERIC, null );
	$string = str_replace(',', '.', $string);
	$thousand_separator = ( $locale['thousands_sep'] == '' ) ? '.' : $locale['thousands_sep'];
	$decimal_separator = $locale['decimal_point'];
	return @utf8_encode(number_format( $string, $decimals, $decimal_separator, $thousand_separator ));
}

echo "<br>";

echo smarty_modifier_number_format('12,90 g');

After finding the correct locale you have to write it into the "C" setting in ProcessWire like described here https://processwire.com/talk/topic/15691-warning-about-server-locale-after-update-from-3052-3053-help/?do=findComment&amp;comment=155654

 

 

  • Like 3

Share this post


Link to post
Share on other sites

Such a script could be a nice troubleshooter for beginners if it were included in the backend somewhere - maybe worth a PR? 🙂 

It could be a simple InputfieldMarkup where the Locale translation happens.

  • Like 1

Share this post


Link to post
Share on other sites

Hi there,

I wanted to share for all newbies my almost translated comments code. I'm using this with the blog profile (PW 3.0.123).

<?php

	// blog post content
	echo ukBlogPost(page());

  // comments list with all options specified (these are the defaults)
  echo $page->comments->render(array(
      'headline' => '<h3 id="comments">Kommentare</h3>',
      'commentHeader' => '{cite} schrieb am {created}',
      'dateFormat' => 'd.m.Y',
      'encoding' => 'UTF-8',
      'replyLabel' => 'Antworten',
      'admin' => false, // shows unapproved comments if true
  ));

  // comments form with all options specified (these are the defaults)
  echo $page->comments->renderForm(array(
      'headline' => "<h3>Kommentar schreiben</h3>",
      'successMessage' => "<p class='success'>Vielen Dank für Ihren Kommentar.</p>",
      'errorMessage' => "<p class='error'>Your submission was not saved due to one or more errors. Please check that you have completed all fields before submitting again.</p>",
      'processInput' => true,
      'encoding' => 'UTF-8',
      'attrs' => array(
          'id' => 'CommentForm',
          'action' => './',
          'method' => 'post',
          'class' => '',
          'rows' => 5,
          'cols' => 50,
          ),
      'labels' => array(
          'cite' => 'Ihr Name',
          'email' => 'Ihre E-Mail',
          'text' => 'Kommentar',
          'submit' => 'Absenden',
          'website' => 'Webseite',
      ),
      // the name of a field that must be set (and have any non-blank value), typically set in Javascript to keep out spammers
      // to use it, YOU must set this with a <input hidden> field from your own javascript, somewhere in the form
      'requireSecurityField' => '', // not used by default
      ));

  ?>

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...