Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Changes
Page history
update for Laravel 5.4
authored
Feb 06, 2017
by
Vladimir Schneider
Hide whitespace changes
Inline
Side-by-side
Installation.md
View page @
e9b87153
...
...
@@ -6,7 +6,7 @@
"vsch/laravel-translation-manager"
:
"~2.2"
}
```
if you are not going to be customizing the web interface it is highly recommended that you
add automatic asset publishing for this package after upgrade in your project's
composer.json:
...
...
@@ -20,7 +20,7 @@
]
}
,
```
Otherwise a future update, that needs new assets, will not work properly. composer does not
run post-update scripts of packages.
...
...
@@ -51,7 +51,7 @@
}
}
```
2.
After updating composer, add the ServiceProviders to the providers array in config/app.php
and comment out the original TranslationServiceProvider:
...
...
@@ -62,13 +62,13 @@
//Vsch\UserPrivilegeMapper\UserPrivilegeMapperServiceProvider::class,
Collective\Html\HtmlServiceProvider
::
class
,
```
The TranslationServiceProvider is an extension to the standard functionality and is required
in order for the web interface to work properly. It is backward compatible with the existing
Translator since it is a subclass of it and only overrides implementation for new features.
##### Removing dependency on UserPrivilegeMapper from service providers array
**If you are upgrading from version 2.0.x of LTM**
you need to remove the dependency to
UserPrivilegeMapper from your application service providers, shown commented out above.
...
...
@@ -78,15 +78,15 @@
'Form'
=>
Collective\Html\FormFacade
::
class
,
'Html'
=>
Collective\Html\HtmlFacade
::
class
,
```
##### Removing dependency on UserPrivilegeMapper from facade alias array
**If you are upgrading from version 2.0.x of LTM**
you need to remove the dependency to
UserPrivilegeMapper from your application facade alias array, shown commented out above.
4.
##### Publishing and running migrations
You need to publish then run the migrations for this package:
```
bash
...
...
@@ -108,7 +108,7 @@
5.
##### Publishing the configuration
You need to publish the config file for this package. This will add the file
`config/laravel-translation-manager.php`
...
...
@@ -121,15 +121,15 @@
```
bash
$
php artisan vendor:publish
--provider
=
"Vsch
\T
ranslationManager
\M
anagerServiceProvider"
--tag
=
public
```
7.
##### Configuring WebUI Route
By default the web interface of the translation manager is no longer mapped to a route. To
make it available at
`http://yourdomain.com/translations`
. Add the following to your
`routes/web.php`
file:
```
php
```
use Vsch\TranslationManager\Translator;
\Route::group(['middleware' => 'web', 'prefix' => 'translations'], function () {
...
...
@@ -143,21 +143,23 @@
```
php
/*
|--------------------------------------------------------------------------
| Routes group config
|--------------------------------------------------------------------------
|
| The default group settings for the elFinder routes.
|
*/
'route'
=>
[
'prefix'
=>
'translations'
,
'middleware'
=>
[
'web'
,
'auth'
],
],
|--------------------------------------------------------------------------
| Routes group config
|--------------------------------------------------------------------------
|
| The default group settings for the elFinder routes.
|
*/
return
array
(
'route'
=>
[
'prefix'
=>
'translations'
,
'middleware'
=>
[
'web'
,
'auth'
],
],
);
```
8.
##### Setting up user authorization
TranslationManager uses Laravel 5.2 abilities for providing authorization for various
translation functions. These abilities can be defined in the app's
`AuthServiceProvider::boot`
function, see example below.
...
...
@@ -166,10 +168,10 @@
*
`ltm-admin-translations`
true/false if user can administer translations only used if
`admin_translations`
option is set to true in LTM config.
*
`ltm-bypass-lottery`
true/false if user bypasses the missing key lottery and all missing
keys are displayed for the user.
*
`ltm-list-editors`
true/false, if user can manage per locale user list. This one is
optional and only used if you have
`user_locales_enabled`
set to
`true`
in the config file.
See:
...
...
@@ -178,9 +180,9 @@
this ability function takes 3 arguments:
1. `$user` - the currently logged in user
2. `$connection_name` - current connection name, '' or null means default
3. `&$user_list` - reference in which to return the list of users that can be managed by
the currently logged in user.
...
...
@@ -192,7 +194,7 @@
be able to edit translations in any locale. If you don't want a user to access any
locales then they should not have access to the LTM web UI through the Laravel
middleware authorization mechanism.
Here is an example implementing these abilities in the app's
`AuthServiceProvider::boot`
function:
...
...
@@ -233,14 +235,14 @@
9.
##### Yandex assisted translations
Assisted translations requires setting the
`yandex_translator_key`
to your Yandex API key in
the
`config/laravel-translation-manager.php`
file, it is free to get and use. See:
<https://tech.yandex.com/translate/>
10.
##### Overriding the Web Interface Translations
If you want to override the Translation Manager web interface translations or add another
locale you will need to publish the language files to your project by executing:
...
...
@@ -252,7 +254,7 @@
11.
##### Customizing Views
If you want to customize views for the Translation Manager web interface you will need to
publish the views to your project by executing:
...
...
@@ -265,7 +267,7 @@
12.
##### Markdown to HTML conversion
This option can be used to automatically convert translations for keys with a given suffix
to HTML and store the result for a key with the suffix removed. Can be used for translations
that contain HTML. By default this option is disabled. Enabling it would require that you
...
...
@@ -274,7 +276,7 @@
13.
##### Enabling Edit In-Place on you pages
Allowing edit in-place of your site's pages will require some modification to views to
support this functionality
[[Markdown to HTML conversion|Configuration#markdown-to-html-conversion]]
...
...
...
...