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 wiki after markdown reformat
authored
May 30, 2016
by
Vladimir Schneider
Show whitespace changes
Inline
Side-by-side
Installation.md
View page @
255cbdf8
1.
Require this package in your composer.json and run composer update (or run
`composer require
vsch/laravel-translation-manager:*`
directly):
...
...
@@ -86,9 +85,9 @@
**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:
4.
You need to publish then run the migrations for this package:
```bash
$ php artisan vendor:publish --provider="Vsch\TranslationManager\ManagerServiceProvider" --tag=migrations
...
...
@@ -109,9 +108,9 @@ You need to publish then run the migrations for this package:
translation related tables. See
[[Changing the database name|Configuration#changing-the-database-name]]
5.
##### Publishing the configuration
You need to publish the config file for this package. This will add the file
5.
You need to publish the config file for this package. This will add the file
`config/laravel-translation-manager.php`
```bash
...
...
@@ -131,10 +130,9 @@ You need to publish the config file for this package. This will add the file
routes, 'web' is required 'auth' is optional, you can add any other middleware to the route
that you require.
8.
##### Setting up user authorization
TranslationManager uses Laravel 5.2 abilities for providing authorization for various
8.
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.
...
...
@@ -143,8 +141,8 @@ You need to publish the config file for this package. This will add the file
- `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-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
...
...
@@ -157,17 +155,17 @@ You need to publish the config file for this package. This will add the file
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.
3. `&$user_list` - reference in which to return the list of users that can be managed by
the
currently logged in user.
This should only return a list of users that have access to the translation manager
web
UI. Please keep in mind that by default a user can modify any locale if there is
no
entry for this user in the `ltm_user_locales` table or if the entry is null or
empty. By
this measure the table contains entries for users wih limited access. Any
user that has
access to translation manager web UI and no entry in the
`ltm_user_locales` table will
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.
This should only return a list of users that have access to the translation manager
web
UI. Please keep in mind that by default a user can modify any locale if there is
no
entry for this user in the `ltm_user_locales` table or if the entry is null or
empty. By
this measure the table contains entries for users wih limited access. Any
user that has
access to translation manager web UI and no entry in the
`ltm_user_locales` table will
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:
...
...
@@ -213,11 +211,10 @@ You need to publish the config file for this package. This will add the file
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 you
r
project by executing:
10.
If you want to override the Translation Manager web interface translations or add anothe
r
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
...
...
@@ -226,10 +223,10 @@ If you want to override the Translation Manager web interface
This will copy the translations to your project and allow you to view/edit them in the
translation manager web interface.
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:
11.
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
...
...
@@ -239,15 +236,16 @@ If you want to customize views for the Translation Manager web interface
`resources/views/vendor/laravel-translation-manager` directory. See:
[[Modifying the default Views|Configuration#modifying-the-default-views]]
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
12.
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.
##### 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]]
13.
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]]