Skip to content

Commit

Permalink
Update to 3.2.0
Browse files Browse the repository at this point in the history
- Code refactoring
- Modernized the user experience
- Moved codebase to https://github.com/Jako/Babel/
- Show the Babel button only on resources in contexts referenced in `babel.contextKeys` system setting
- Show the context column in the custom manager page only for contexts referenced in `babel.contextKeys` system setting
- System settings tab in custom manager page
  • Loading branch information
Jako committed Feb 7, 2024
1 parent 320299d commit 3da449c
Show file tree
Hide file tree
Showing 146 changed files with 13,297 additions and 5,208 deletions.
22 changes: 12 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
_build/build.config.php
core.config.php
.settings/
.project
.buildpath
/nbproject
*.iml
.idea/
*.ipr
*.iws
/config.core.php
config.core.php

_build/site

icon/*.svg

_packages/*.*
!_packages/.gitignore
!_packages/*.zip

node_modules/
core/components/*/vendor/
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

574 changes: 287 additions & 287 deletions core/components/babel/docs/license.txt → LICENSE.md

Large diffs are not rendered by default.

32 changes: 0 additions & 32 deletions README.markdown

This file was deleted.

41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[![Default Lexicon](https://hosted.weblate.org/widget/modx-extras/babel/standard/svg-badge.svg)](https://hosted.weblate.org/projects/modx-extras/babel/)

# Babel

The easy way for your multilingual site!

## Features

Babel is an Extra for MODx Revolution that helps you to manage your multilingual
websites using different contexts. Babel even supports managing several different
multilingual websites within one MODx instance by using so-called context groups.

Babel maintains links between translated resources. In the manager you can use
the Babel Box to easily switch between the different language versions
of your resources. Translations can be created automatically by Babel or defined
manually.

Additionally, Babel can be used to synchronize certain template variables (TVs)
of translated resources which should be the same in every context (language).

## Installation

MODX Package Management

## Usage

Install via package manager and fill the system setting `babel.contextKeys` with
a comma separated list of context keys which should be used to link multilingual
resources.

## Documentation

For more information please read the [documentation](https://mikrobi.github.io/babel/).

## License

The project is licensed under the [GPLv2 license](https://github.com/mikrobi/babel/LICENSE.md).

## Translations

Translations of the package can be made for the [Default Lexicon](https://hosted.weblate.org/projects/modx-extras/babel/standard/), the [Permissions Lexicon](https://hosted.weblate.org/projects/modx-extras/babel/permissions/), the [Properties Lexicon](https://hosted.weblate.org/projects/modx-extras/babel/properties/) and the [System Settings Lexicon](https://hosted.weblate.org/projects/modx-extras/babel/system-settings/)
98 changes: 73 additions & 25 deletions _build/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "Babel",
"lowCaseName": "babel",
"description": "The easy way for your multilingual site!",
"author": "Jakob Class, goldsky",
"version": "3.1.1-pl",
"author": "Jakob Class, Rico Goldsky, Joshua Luckers, Thomas Jakobi",
"version": "3.2.0",
"package": {
"menus": [
{
Expand All @@ -21,36 +21,53 @@
"properties": [
{
"name": "resourceId",
"description": "babellinks.resourceId",
"value": ""
},
{
"name": "tpl",
"description": "babeltranslation.tpl",
"value": "babelLink"
"value": "tplBabellink"
},
{
"name": "wrapperTpl",
"value": ""
},
{
"name": "activeCls",
"description": "babeltranslation.activeCls",
"value": "active"
},
{
"name": "showUnpublished",
"description": "babeltranslation.showUnpublished",
"type": "combo-boolean",
"value": "0"
},
{
"name": "showCurrent",
"description": "babeltranslation.showCurrent",
"type": "combo-boolean",
"value": "0"
},
{
"name": "includeUnlinked",
"description": "babeltranslation.includeUnlinked",
"type": "combo-boolean",
"value": "0"
},
{
"name": "ignoreSiteStatus",
"type": "combo-boolean",
"value": "0"
},
{
"name": "restrictToGroup",
"type": "combo-boolean",
"value": "0"
},
{
"name": "toArray",
"type": "combo-boolean",
"value": "0"
},
{
"name": "toPlaceholder",
"value": ""
}
]
},
Expand All @@ -61,22 +78,18 @@
"properties": [
{
"name": "resourceId",
"description": "babeltranslation.resourceId",
"value": ""
},
{
"name": "contextKey",
"description": "babeltranslation.contextKey",
"value": ""
},
{
"name": "cultureKey",
"description": "babeltranslation.cultureKey",
"value": ""
},
{
"name": "showUnpublished",
"description": "babeltranslation.showUnpublished",
"type": "combo-boolean",
"value": "0"
}
Expand All @@ -97,41 +110,76 @@
"OnResourceSort"
]
}
],
"chunks": [
{
"name": "tplBabellink",
"file": "babellink.chunk.html"
},
{
"name": "tplBabellinkWrapper",
"file": "babellinkwrapper.chunk.html"
}
]
},
"systemSettings": [
{
"key": "debug",
"type": "combo-boolean",
"area": "system",
"value": "0"
},
{
"key": "contextKeys",
"type": "textfield",
"area": "common",
"area": "system",
"value": ""
},
{
"key": "restrictToGroup",
"type": "combo-boolean",
"area": "system",
"value": "1"
},
{
"key": "displayText",
"area": "system",
"value": "language"
},
{
"key": "babelTvName",
"type": "textfield",
"area": "common",
"area": "system",
"value": "babelLanguageLinks"
},
{
"key": "syncTvs",
"type": "textfield",
"area": "common",
"area": "system",
"value": ""
}
]
},
"dependencies": [
{
"name": "php",
"version": ">=7.2"
},
{
"name": "modx",
"version": ">=2.4"
}
],
"build": {
"readme": "docs/readme.txt",
"license": "docs/license.txt",
"changelog": "docs/changelog.txt",
"readme": "docs/readme.md",
"license": "docs/license.md",
"changelog": "docs/changelog.md",
"resolver": {
"after": [
"setupoptions.resolver.php",
"babelevents.resolver.php"
"resolve.setupoptions.php",
"resolve.permissions.php",
"resolve.babelevents.php"
]
},
"setupOptions": {
"source": "setup.options.php"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,33 +1,12 @@
<?php
/**
* Babel
*
* Copyright 2010 by Jakob Class <[email protected]>
*
* This file is part of Babel.
*
* Babel 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 2 of the License, or (at your option) any later
* version.
*
* Babel 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
* Babel; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
* Suite 330, Boston, MA 02111-1307 USA
*
* @package babel
*/
/**
* Resolves creating/removing babel events.
*
* @author Jakob Class <[email protected]>
*
* @package babel
* @subpackage build
*
* @var array $options
* @var xPDOObject $object
*/

/**
Expand All @@ -36,7 +15,7 @@
* @param integer $service see https://github.com/modxcms/revolution/blob/2.x/core/model/modx/modx.class.php#L2005-L2010
* @return bool
*/
function createEvent(modX &$modx, $name, $service = 0)
function createEvent(modX $modx, $name, $service = 0)
{
$success = true;
$ct = $modx->getCount('modEvent', [
Expand Down Expand Up @@ -67,7 +46,7 @@ function createEvent(modX &$modx, $name, $service = 0)
* @param string $name
* @return bool
*/
function removeEvent(modX &$modx, $name)
function removeEvent(modX $modx, $name)
{
$success = true;
/** @var modEvent $event */
Expand Down
Loading

0 comments on commit 3da449c

Please sign in to comment.