Changes
Page history
add pop-up edit title translations from PHP to JS
authored
Jan 05, 2017
by
Vladimir Schneider
Show whitespace changes
Inline
Side-by-side
Installation.md
View page @
6ea9e6a5
...
...
@@ -7,7 +7,7 @@
}
```
-
if you are not going to be customizing the web interface it is highly recommended that you
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:
...
...
@@ -93,7 +93,6 @@
$
php artisan vendor:publish
--provider
=
"Vsch
\T
ranslationManager
\M
anagerServiceProvider"
--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,7 +101,6 @@
$
php artisan vendor:publish
--provider
=
"Vsch
\T
ranslationManager
\M
anagerServiceProvider"
--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
...
...
@@ -117,7 +115,6 @@
```
bash
$
php artisan vendor:publish
--provider
=
"Vsch
\T
ranslationManager
\M
anagerServiceProvider"
--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`
...
...
@@ -139,7 +136,6 @@
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
...
...
@@ -159,7 +155,6 @@
'middleware'
=>
[
'web'
,
'auth'
],
],
```
8.
##### Setting up user authorization
...
...
@@ -169,15 +164,15 @@
You need to define the following abilities:
-
`ltm-admin-translations` true/false if user can administer translations only used if
*
`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
*
`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:
*
`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:
[
Enabling per locale user access control
](
Configuration#enabling-per-locale-user-access-control
)
this ability function takes 3 arguments:
...
...
@@ -189,14 +184,14 @@
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:
...
...
@@ -227,19 +222,20 @@
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
translation keys so that any missing translations will be visible to them instead of relying
on the session winning the missing key lottery before logging missing keys.
**If you are upgrading from version 2.0.x of LTM** you need to remove the
UserPrivilegeMapper definitions added in your application, probably in
`app/Providers/AppServiceProvider.php`
**If you are upgrading from version 2.0.x of LTM**
you need to remove the UserPrivilegeMapper
definitions added in your application, probably in
`app/Providers/AppServiceProvider.php`
9.
##### Yandex assisted translations
9.
Yandex a
ssisted 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:
A
ssisted 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.
...
...
@@ -251,7 +247,6 @@
```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.
...
...
@@ -264,7 +259,6 @@
```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]]
...
...
...
...