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 @@
...
@@ -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
add automatic asset publishing for this package after upgrade in your project's
composer.json:
composer.json:
...
@@ -93,7 +93,6 @@
...
@@ -93,7 +93,6 @@
$
php artisan vendor:publish
--provider
=
"Vsch
\T
ranslationManager
\M
anagerServiceProvider"
--tag
=
migrations
$
php artisan vendor:publish
--provider
=
"Vsch
\T
ranslationManager
\M
anagerServiceProvider"
--tag
=
migrations
$
php artisan migrate
$
php artisan migrate
```
```
If you want to create translation tables in another database you will need to do it manually
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
or setup a connection name with the default database you want to use and apply the migration
to it specifically:
to it specifically:
...
@@ -102,7 +101,6 @@
...
@@ -102,7 +101,6 @@
$
php artisan vendor:publish
--provider
=
"Vsch
\T
ranslationManager
\M
anagerServiceProvider"
--tag
=
migrations
$
php artisan vendor:publish
--provider
=
"Vsch
\T
ranslationManager
\M
anagerServiceProvider"
--tag
=
migrations
$
php artisan migrate
--database
=
"connection_name"
$
php artisan migrate
--database
=
"connection_name"
```
```
Where
`connection_name`
is the name of the connection to use for the migrations. You will
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
also need to configure the translation manager to use this as the default connection for
translation related tables. See
translation related tables. See
...
@@ -117,7 +115,6 @@
...
@@ -117,7 +115,6 @@
```
bash
```
bash
$
php artisan vendor:publish
--provider
=
"Vsch
\T
ranslationManager
\M
anagerServiceProvider"
--tag
=
config
$
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
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`
add the assets to
`public/vendor/laravel-translation-manager`
...
@@ -139,7 +136,6 @@
...
@@ -139,7 +136,6 @@
Translator
::
routes
();
Translator
::
routes
();
});
});
```
```
Change the middleware and/or the prefix to adjust it to your site's requirements.
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
If your
`config/laravel-translation-manager.php`
is of an earlier version you can delete the
...
@@ -159,7 +155,6 @@
...
@@ -159,7 +155,6 @@
'middleware'
=>
[
'web'
,
'auth'
],
'middleware'
=>
[
'web'
,
'auth'
],
],
],
```
```
8.
8.
##### Setting up user authorization
##### Setting up user authorization
...
@@ -169,15 +164,15 @@
...
@@ -169,15 +164,15 @@
You need to define the following abilities:
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.
`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.
keys are displayed for the user.
-
`ltm-list-editors` true/false, if user can manage per locale user list. This one is
*
`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
optional and only used if you have
`user_locales_enabled`
set to
`true`
in the config
file.
file.
See:
See:
[
Enabling per locale user access control
](
Configuration#enabling-per-locale-user-access-control
)
[
Enabling per locale user access control
](
Configuration#enabling-per-locale-user-access-control
)
this ability function takes 3 arguments:
this ability function takes 3 arguments:
...
@@ -189,14 +184,14 @@
...
@@ -189,14 +184,14 @@
3. `&$user_list` - reference in which to return the list of users that can be managed by
3. `&$user_list` - reference in which to return the list of users that can be managed by
the currently logged in user.
the currently logged in user.
This should only return a list of users that have access to the translation manager
This should only return a list of users that have access to the translation manager
web
web
UI. Please keep in mind that by default a user can modify any locale if there is
UI. Please keep in mind that by default a user can modify any locale if there is
no
no
entry for this user in the `ltm_user_locales` table or if the entry is null or
entry for this user in the `ltm_user_locales` table or if the entry is null or
empty. By
empty. By
this measure the table contains entries for users wih limited access. Any
this measure the table contains entries for users wih limited access. Any
user that has
user that has
access to translation manager web UI and no entry in the
access to translation manager web UI and no entry in the
`ltm_user_locales` table will
`ltm_user_locales` table will
be able to edit translations in any locale. If you
be able to edit translations in any locale. If you
don't want a user to access any
don't want a user to access any
locales then they should not have access to the LTM
locales then they should not have access to the LTM
web UI through the Laravel
web UI through the Laravel
middleware authorization mechanism.
middleware authorization mechanism.
Here is an example implementing these abilities in the app's
`AuthServiceProvider::boot`
Here is an example implementing these abilities in the app's
`AuthServiceProvider::boot`
function:
function:
...
@@ -227,19 +222,20 @@
...
@@ -227,19 +222,20 @@
return
$user_list
;
return
$user_list
;
});
});
```
```
In this example the User model implements two attributes: is_admin and is_editor. The admin
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
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
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
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.
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
**If you are upgrading from version 2.0.x of LTM**
you need to remove the UserPrivilegeMapper
UserPrivilegeMapper definitions added in your application, probably in
definitions added in your application, probably in
`app/Providers/AppServiceProvider.php`
`app/Providers/AppServiceProvider.php`
9.
##### Yandex assisted translations
9.
Yandex a
ssisted translations requires setting the
`yandex_translator_key`
to your Yandex API
A
ssisted translations requires setting the
`yandex_translator_key`
to your Yandex API
key in
key in
the
`config/laravel-translation-manager.php`
file, it is free to get and use. See:
the
`config/laravel-translation-manager.php`
file, it is free to get and use. See:
<https://tech.yandex.com/translate/>
<https://tech.yandex.com/translate/>
10.
10.
...
@@ -251,7 +247,6 @@
...
@@ -251,7 +247,6 @@
```bash
```bash
$ php artisan vendor:publish --provider="Vsch\TranslationManager\ManagerServiceProvider" --tag=lang
$ 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
This will copy the translations to your project and allow you to view/edit them in the
translation manager web interface.
translation manager web interface.
...
@@ -264,7 +259,6 @@
...
@@ -264,7 +259,6 @@
```bash
```bash
$ php artisan vendor:publish --provider="Vsch\TranslationManager\ManagerServiceProvider" --tag=views
$ php artisan vendor:publish --provider="Vsch\TranslationManager\ManagerServiceProvider" --tag=views
```
```
This will copy the views to your project under the
This will copy the views to your project under the
`resources/views/vendor/laravel-translation-manager` directory. See:
`resources/views/vendor/laravel-translation-manager` directory. See:
[[Modifying the default Views|Configuration#modifying-the-default-views]]
[[Modifying the default Views|Configuration#modifying-the-default-views]]
...
...
...
...