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
Revert "update wiki formatting"
authored
Oct 31, 2016
by
Vladimir Schneider
This reverts commit ff6ba821ee090a7c3cf03354fc8592ab441cf197.
Hide whitespace changes
Inline
Side-by-side
Installation.md
View page @
f7c97793
1.
Require this package in your composer.json and run composer update (or run
`composer require
vsch/laravel-translation-manager:*`
directly):
1.
Require this package in your composer.json and run composer update (or run
`composer require
vsch/laravel-translation-manager:*`
directly):
```json
"require": {
"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,9 +51,9 @@
}
}
```
2.
After updating composer, add the ServiceProviders to the providers array in config/app.php
and comment out the original TranslationServiceProvider:
2.
After updating composer, add the ServiceProviders to the providers array in config/app.php
and comment out the original TranslationServiceProvider:
```php
//Illuminate\Translation\TranslationServiceProvider::class,
...
...
@@ -62,38 +62,38 @@
//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.
3.
add the Facade to the aliases array in config/app.php:
3.
add the Facade to the aliases array in config/app.php:
```php
'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.
4.
##### Publishing and running migrations
You need to publish then run the migrations for this package:
```bash
$ php artisan vendor:publish --provider="Vsch\TranslationManager\ManagerServiceProvider" --tag=migrations
$ php artisan migrate
```
If you want to create translation tables in another database you will need to do it manually
or setup a connection name with the default database you want to use and apply the migration
to it specifically:
...
...
@@ -102,41 +102,41 @@
$ php artisan vendor:publish --provider="Vsch\TranslationManager\ManagerServiceProvider" --tag=migrations
$ php artisan migrate --database="connection_name"
```
Where `connection_name` is the name of the connection to use for the migrations. You will
also need to configure the translation manager to use this as the default connection for
translation related tables. See
[[Changing the database name|Configuration#changing-the-database-name]]
5.
5.
##### Publishing the configuration
You need to publish the config file for this package. This will add the file
`config/laravel-translation-manager.php`
```bash
$ php artisan vendor:publish --provider="Vsch\TranslationManager\ManagerServiceProvider" --tag=config
```
6.
You need to publish the web assets used by the translation manager web interface. This will
add the assets to
`public/vendor/laravel-translation-manager`
6.
You need to publish the web assets used by the translation manager web interface. This will
add the assets to
`public/vendor/laravel-translation-manager`
```bash
$ php artisan vendor:publish --provider="Vsch\TranslationManager\ManagerServiceProvider" --tag=public
```
7.
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:
7.
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 () {
Translator::routes();
});
```
Change the middleware and/or the prefix to adjust it to your site's requirements.
If your `config/laravel-translation-manager.php` is of an earlier version you can delete the
...
...
@@ -156,10 +156,10 @@
'middleware' => ['web', 'auth'],
],
```
8.
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.
...
...
@@ -224,7 +224,7 @@
return $user_list;
});
```
In this example the User model implements two attributes: is_admin and is_editor. The admin
user is allowed to manage translations: import, delete, export, etc., the editor user can
only edit existing translations. However, both of these users will always log missing
...
...
@@ -235,49 +235,49 @@
UserPrivilegeMapper definitions added in your application, probably in
`app/Providers/AppServiceProvider.php`
9.
Yandex 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/>
9.
Yandex 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.
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:
```bash
$ php artisan vendor:publish --provider="Vsch\TranslationManager\ManagerServiceProvider" --tag=lang
```
This will copy the translations to your project and allow you to view/edit them in the
translation manager web interface.
11.
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:
```bash
$ php artisan vendor:publish --provider="Vsch\TranslationManager\ManagerServiceProvider" --tag=views
```
This will copy the views to your project under the
`resources/views/vendor/laravel-translation-manager` directory. See:
[[Modifying the default Views|Configuration#modifying-the-default-views]]
12.
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
also install a package that does the HTML conversion. See
[[Markdown to HTML conversion|Configuration#markdown-to-html-conversion]]
13.
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]]
...
...
...
...