Skip to content

A webtrees 2.1/2.2 custom module to change the webtrees language by URL requests with the language provided as an URL parameter.

License

Notifications You must be signed in to change notification settings

Jefferson49/ChangeLanguageWithURL

Repository files navigation

Latest Release webtrees major version webtrees major version

ChangeLanguageWithURL

A weebtrees 2.1/2.2 custom module to change the webtrees language by URL requests with the language provided as an URL parameter.

What are the benefits of this module?

  • Change the webtrees language without interaction in the user interface (webtrees front end)
  • Add a language change request to any existing webtrees URL
  • Provide a language mechanism for an integration of webtrees into a content management system (CMS)
    • If webtrees is integrated into a content management system (e.g. Joomla ), the languages can be aligned between the CMS and webtrees
    • The purpose of the module is to handover the CMS language to webtrees using a specific URL parameter. If the module receives the URL parameter, the language in webtrees is changed accordingly

Installation

  • Install and use Custom Module Manager for an easy and convenient installation of webtrees custom modules.
  • Open the Custom Module Manager view in webtrees, scroll to "ChangeLanguageWithURL", and click on the "Install Module" button.

Manual installation:

  • Download the latest release of the module by downloading the "change_language_with_url_v*.zip" file from "Assets". Do not download "Source code.zip".
  • Unzip the downloaded file and copy the included folder "change_language_with_url" into the "module_v4" folder of your webtrees installation

Webtrees version

The latest release of the module was developed and tested with webtrees 2.1.21 and 2.2.0, but should also run with any other webtrees 2.1/2.2 versions.

URL parameters to specify the language

In general, the module allows to add the language and the language after sign out as parameters to the end of the URL. The format for the URL parameters is as follows:

language=LANGUAGE_TAG

language_after_signout=LANGUAGE_TAG|reset
  • with LANGUAGE_TAG = en-GB, de, fr, es, ...
  • The available language tags in webtrees can be found within the supported webtrees languages
  • With the following URL parameter, the language after sign out can be reset to the default, where webtrees selects the browser language after sign out:
language_after_signout=reset

URL format and Example URLs

Depending on the URL, the URL parameter for the language needs to be added with a "&" or a "?" character.

If the language to be added is the first URL parameter, it needs to be added with a "?" character:

https://MY_SITE/webtrees/tree/MY_TREE/search-general?language=en-GB

If the language to be added is not the first URL parameter (i.e. another parameter with a "?" character is used before), it needs to be added with a "&" character:

https://MY_SITE/webtrees/index.php?route=%2Ftree%2FMY_TREE%2Fsearch-general&language=es

If both the language and the language after signout shall be changed in parallel, two URL parameters can be added:

https://MY_SITE/webtrees/index.php?route=%2Ftree%2FMY_TREE%2Fsearch-general&language=es&language_after_signout=fr

Bugs and Feature Requests

If you experience any bugs or have a feature request for this webtrees custom module, you can create a new issue.

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Github repository

https://github.com/Jefferson49/ChangeLanguageWithURL

About

A webtrees 2.1/2.2 custom module to change the webtrees language by URL requests with the language provided as an URL parameter.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published