Skip to content

Instantly share code, notes, and snippets.

@deckerweb
Last active January 2, 2016 05:58
Show Gist options
  • Select an option

  • Save deckerweb/8260082 to your computer and use it in GitHub Desktop.

Select an option

Save deckerweb/8260082 to your computer and use it in GitHub Desktop.
DE: Plugin "Load Custom Translations" (Eigene Übersetzungen laden) - Beispiel-Code für Ihr Functionality- oder Drittanbieter-Plugin, oder für Schnipselverwaltung "Code Snippets" oder "Toolbox" Plugin, oder eben für die "functions.php" Datei Ihres Themes bzw. Child Themes. ----- // ----- EN: Load Custom Translations plugin - example code for your…
<?php
/**
* Add custom translations via plugin "Load Custom Translations" by DECKERWEB
*/
if ( defined( 'LCTRL_PLUGIN_BASEDIR' ) ) :
lct_load_custom_translations(
array(
'plugin_key' => 'tablepress',
'plugin_textdomains' => array(
'tablepress'
),
'unload_original' => TRUE,
'unload_textdomains' => array( 'tablepress' )
)
);
endif; // end if LCTRL plugin check
// EN: Short version - DE: Kurzversion:
/**
* Add custom translations via plugin "Load Custom Translations" by DECKERWEB
*/
if ( defined( 'LCTRL_PLUGIN_BASEDIR' ) ) :
lct_load_custom_translations(
array(
'plugin_key' => 'tablepress',
'plugin_textdomains' => array(
'tablepress'
),
)
);
endif; // end if LCTRL plugin check
@deckerweb

Copy link
Copy Markdown
Author

German: Erklärung - Deutsch:

Parameter 'plugin_key' = ID des Plugins, dies ist automatisch der Präfix (Vorsilbe) der eigenen Übersetzungsdatei, also z.B. tablepress-de_DE.mo / .po (Beispiel: 'tablepress')

Parameter 'plugin_textdomains' = Verwendete Textdomains des Plugins, welches Sie übersetzen wollen. Dies können mehrere sein, dann kommagetrennte ID-Strings angeben! (Beispiel: 'tablepress') --- Hinweis: es ist kein Problem wenn die Werte von Plugin Key und Plugin Textdomains übereinstimmen in einem Wert.

Parameter 'unload_original' = Ob die Original-Textdomains des zu übersetzenden Plugins vorher deaktiviert werden sollen. Die Standardeinstellung ist "nein", d.h. Wert steht auf FALSE

Parameter 'unload_textdomains' = Auflistung der originalen Textdomains, deren Laden deaktiviert werden soll. Es können wieder mehrere angegeben werden, ebenfalls kommagetrennt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment