Jump to content

German language pack (de_DE) with formal salutation


dotnetic

Recommended Posts

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

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.

If you want to help, you can clone my ProcessWire environment for language packs which provides an easy way for translating a language pack.

You simply clone it, make changes to the language in ProcessWire and commit the changes back to your (or the german) language pack repository.

This is a boilerplate which could work with any language, but right now it is tailored to the german language pack.

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

Big thanks to @Nico Knoll and @yellowled for their initial work on the translations.

  • Like 16
  • Thanks 2
Link to comment
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
Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

  • 3 weeks later...

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

Link to comment
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 4
Link to comment
Share on other sites

  • 1 month later...

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
      ));

  ?>

 

Link to comment
Share on other sites

  • 1 year later...

Hello @gebeer, yes, I still maintain it, but had little time in the past. The last version was for PW stable 3.0.128.

Right now PW stable is at version 3.0.148. I try to have a look at it in the next days and update it, if applicable.

  • Like 4
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • dotnetic changed the title to German language pack (de_DE) with formal salutation

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...