DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: Salutation Switcher

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed:2006-06-13T17:31:54
Author:Oliver Klee
Email:typo3-coding@oliverklee.de
Info 3:
Info 4:

EXT: Salutation Switcher

Extension Key: salutationswitcher

Copyright 2005, Oliver Klee, <typo3-coding@oliverklee.de>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

EXT: Salutation Switcher 1

Introduction 1

What does it do? 1

Configuration 1

Tutorial 1

Reference 2

Suffixes for localization string keys 2

Known problems 2

To-Do list 2

Changelog 2

Introduction

This extension is obsolete. It has been superseded by the *oelib* extension. Please use that extension instead.

If you want the bleeding edge of this extension, you can download it from the SourceForge.net CVS as tx_salutationswitcher . See the Typo3 Wiki for more information.

If you find any bugs in this extension, please report them in the Typo3 bugtracker under the project tx_salutationswitcher .

What does it do?

In English, there is only one salutation: “You”. In many other languages, there are formal and informal salutations (German: “Sie” vs.“du”/”ihr”, French: “vous” vs.“tu”).

If you use the informal salutation e.g.on a business site, that is very impolite. If, on the other hand, you use the formal salutation e.g.on a site targeted at children or a site by students for students, this will appear as awkward and inappropriate.

This extension strives to solve this problem by providing extension authors with a way to have formal as well as informal localization strings in their front end extension, allowing the site administrator to switch on a per-extension basis.

This extension is targeted at extension developers and translators.

Configuration

See the tutorial how to change your extension to use the Salutation Switcher. In your TS Setup, set the following option for your extension ( not the Salutation Switcher extension!):

salutation = formal

or

salutation = informal

Tutorial

If you are an extension developer and wish to make use of this extension, this is what to do:

Install this extension.

Enter this extension as a dependency for your extension.

In the start of your class files, replace all occurances ofrequire_on ce(PATH_tslib.'class.tslib_pibase.php');withrequire_once(t3lib_ext Mgm::extPath('salutationswitcher').'class.tx_salutationswitcher.php') ;

Replace all occurances ofextends tslib_pibasewithextends pibase_salutationswitcher

Clear the cache in typo3conf/ and make sure that your extension still runs fine at this point.

Edit your localization files and look for strings that you want to split into formal and informal.

In your TS Setup, set the following option for your extension ( not the Salutation Switcher extension!):

salutation = formal

or

salutation = informal

Add this configuration to you extension documentation.

You only need to change the strings that actually contain a salutation. If no key with the desired suffix is found in the current language, the key without the suffix is tried.

((generated))

Examples

You have the following German string:

'thankyou' => 'Vielen Dank für Ihren Einkauf.',

You split this up, using the suffixes “formal” and “informal”:

'thankyou_formal' => 'Vielen Dank für Ihren Einkauf.',
'thankyou_informal' => 'Vielen Dank für deinen Einkauf.',

If you have any other code that uses that string and you cannot make that code use the Salutation Switcher, you might want to keep the original key, too.

If, for example, you have an English and a formal German localization, you only need to add the informal German strings. This is for two reasons:

In English, there is only the “you”. So you don't need any new strings here. As this extension falls back on the default strings if no keys with the “_formal”/”_informal” suffix are found, you don't need to change the string keys.

If the user of your extension has chosen to use the formal language (and the German localization), this extension doesn't find localized string keys with the “_formal” suffix, falling back on the keys without suffix (which, in your case, use the formal salutation anyway). If the user choses to have the informal language for a change, you newly added strings with the “_informal” suffix to their keys get used.

Reference

Suffixes for localization string keys

The suffixes are appended to the normal keys using an underscore as a separator.

  • _formal
  • _informal

Known problems

This extension only applies to front end plug ins.

To-Do list

check code with PhpLint once PhpLint is a bit more mature

Changelog

0.3.1

  • Improved the documentation.
  • Cleaned up the code a bit.

0.3.0

Improved the documentation.

0.2.0

  • Reduced code duplication.
  • Added check for allowed suffixes.
  • Created an extension icon.

0.1.0

Initial release.

img-1 EXT: Salutation Switcher - 3