Skip to content

Commit

Permalink
[Global] Translation fix (#1115)
Browse files Browse the repository at this point in the history
* Form translations clean + typofix

* Fix js autocollapse "More" label translation

* Fix twig untranslated texts

* Translation fix tabs

* Bugfixes

* Bugfix

* Bugfix

* Modal translations
  • Loading branch information
fchris82 authored and Kristof Jochmans committed Apr 22, 2016
1 parent 56d9312 commit a6d2d62
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 75 deletions.
8 changes: 5 additions & 3 deletions Form/DashboardConfigurationType.php
Expand Up @@ -17,13 +17,15 @@ class DashboardConfigurationType extends AbstractType
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('title');
$builder->add('title', null, array(
'label' => 'kuma_admin.dashboard.configuration.title.label',
));
$builder->add('content', TextareaType::class, array(
'label' => 'Content (raw html)',
'label' => 'kuma_admin.dashboard.configuration.content.label',
'required' => false,
'attr' => array(
'style' => 'width: 1000px',
'rows' => 20
'rows' => 20,
)
));
}
Expand Down
4 changes: 2 additions & 2 deletions Form/GroupType.php
Expand Up @@ -42,8 +42,8 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'expanded' => false,
'required' => true,
'attr' => array(
'class' => 'js-advanced-select form-control advanced-select',
'data-placeholder' => 'Choose the roles...'
'placeholder' => 'settings.group.roles_placeholder',
'class' => 'js-advanced-select form-control advanced-select',
),
)
);
Expand Down
5 changes: 4 additions & 1 deletion Form/RoleType.php
Expand Up @@ -16,7 +16,10 @@ class RoleType extends AbstractType
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('role', TextType::class, array ('required' => true, 'label' => 'settings.role.role' ));
$builder->add('role', TextType::class, array (
'required' => true,
'label' => 'settings.role.role',
));
}

/**
Expand Down
10 changes: 5 additions & 5 deletions Form/UserType.php
Expand Up @@ -51,15 +51,14 @@ public function buildForm(FormBuilderInterface $builder, array $options)
->add('plainPassword', RepeatedType::class, array(
'type' => PasswordType::class,
'required' => $options['password_required'],
'invalid_message' => "errors.password.dontmatch",
'invalid_message' => 'errors.password.dontmatch',
'first_options' => array(
'label' => 'settings.user.password'
),
'second_options' => array(
'label' => 'settings.user.repeatedpassword'
)
)
)
))
->add('email', EmailType::class, array ('required' => true, 'label' => 'settings.user.email'))
->add('adminLocale', ChoiceType::class, array(
'choices' => $languages,
Expand All @@ -81,8 +80,9 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'multiple' => true,
'expanded' => false,
'required' => false,
'attr' => array('class' => 'js-advanced-select form-control advanced-select',
'data-placeholder' => 'Choose the permission groups...'
'attr' => array(
'placeholder' => 'settings.user.roles_placeholder',
'class' => 'js-advanced-select form-control advanced-select',
)
)
);
Expand Down
138 changes: 78 additions & 60 deletions Resources/translations/messages.en.yml
@@ -1,82 +1,100 @@
# Pages
pages:
title: Pages
parts: PageParts
draft: Draft
pagenottranslated: This page is not translated
copyfrom: Copy from language
createemptypage: Create as an empty page
movingconfirmation: You are moving "%title%" to "%target%", are you sure?
title: Pages
parts: PageParts
draft: Draft
pagenottranslated: This page is not translated
copyfrom: Copy from language
createemptypage: Create as an empty page
movingconfirmation: You are moving "%title%" to "%target%", are you sure?

# Modules
modules:
title: Modules
title: Modules

# Settings
settings:
title: Settings
maintanance: Maintenance
scheduled: Scheduled Jobs
version:
bundle: Bundle versions
composer_lock_not_found: No composer.lock file found in your project root
error_parsing_composer: Error parsing composer.lock file, no valid json
error: Something went wrong while fetching the version information. Please try again later.
moreinfo: To update the bundles, run a composer update. It might be possible that you need to upgrade other bundles if you get conflicts.
uptodate: is up-to-date
toupdate: can be updated to
unknown: version information unknown
title: Settings
maintanance: Maintenance
scheduled: Scheduled Jobs
version:
bundle: Bundle versions
composer_lock_not_found: No composer.lock file found in your project root
error_parsing_composer: Error parsing composer.lock file, no valid json
error: Something went wrong while fetching the version information. Please try again later.
moreinfo: To update the bundles, run a composer update. It might be possible that you need to upgrade other bundles if you get conflicts.
uptodate: is up-to-date
toupdate: can be updated to
unknown: version information unknown

# Tools
tools:
title: Tools
clear_frontend_cache: Clear frontend cache
clear_backend_cache: Clear backend cache
clear_all_caches: Clear all caches
shutdown: Shutdown
title: Tools
clear_frontend_cache: Clear frontend cache
clear_backend_cache: Clear backend cache
clear_all_caches: Clear all caches
shutdown: Shutdown

# Forms
form:
cancel: Cancel
delete: Delete
deletesure: Are you sure you want to delete this?
edit: Edit
add: Add New
save: Save
publish: Publish
unpublish: Unpublish
saveasdraft: Save as draft
name: Name
type: Type
error: Error
warning: Warning
headsup: Heads up
forgot:
password: Forgot my password.
permissions: Permissions
properties: Properties
createdat: Created At
updatedat: Updated At
actions: Actions
addfilter: Add filter
choosetypefilter: Filter on
versions: Versions
cancel: Cancel
delete: Delete
deletesure: Are you sure you want to delete this?
edit: Edit
add: Add New
save: Save
publish: Publish
unpublish: Unpublish
saveasdraft: Save as draft
name: Name
type: Type
error: Error
warning: Warning
headsup: Heads up
forgot:
password: Forgot my password.
permissions: Permissions
properties: Properties
createdat: Created At
updatedat: Updated At
actions: Actions
addfilter: Add filter
choosetypefilter: Filter on
versions: Versions
button:
dropdown:
more: More
filter:
clear: Clear
filter: Filter

omnext:
home: Home
title: Welcome!
welcome: Welcome.
information: <strong>Information.</strong> There are no new notifications.
home: Home
title: Welcome!
welcome: Welcome.
information: <strong>Information.</strong> There are no new notifications.

permissions:
you_made_changes: You have made changes to the permissions on this page.
apply_recursively: Apply these changes recursively on all child pages
review_changes: Review your changes
changes: Permission changes
permissions_added: 'The following permissions will be <strong>added</strong>:'
permissions_removed: 'The following permissions will be <strong>removed</strong>:'
role_name: Role name
you_made_changes: You have made changes to the permissions on this page.
apply_recursively: Apply these changes recursively on all child pages
review_changes: Review your changes
changes: Permission changes
permissions_added: 'The following permissions will be <strong>added</strong>:'
permissions_removed: 'The following permissions will be <strong>removed</strong>:'
role_name: Role name

errors:
oauth:
invalid: You are not able to login to Google OAuth, your domain name is probably not allowed.

kuma_admin:
dashboard:
configuration:
title:
label: Title
content:
label: Content (raw html)

kuma_js:
auto_collapse:
more_button_label: More
5 changes: 4 additions & 1 deletion Resources/ui/js/_auto-collapse-buttons.js
Expand Up @@ -26,7 +26,10 @@ kunstmaanbundles.autoCollapseButtons = (function($, window, undefined) {
createMoreDropdown = function() {
// create dom elements
$moreButtonContainer = $('<div class="btn-group btn-group--more">').appendTo($btnGroup);
$moreButton = $('<button class="btn btn-default btn--raise-on-hover dropdown-toggle" data-toggle="dropdown">').text('More ').appendTo($moreButtonContainer);
var label = MORE_BUTTON_LABEL
? MORE_BUTTON_LABEL
: 'More';
$moreButton = $('<button class="btn btn-default btn--raise-on-hover dropdown-toggle" data-toggle="dropdown">').text(label + ' ').appendTo($moreButtonContainer);
$caret = $('<span class="fa fa-caret-down">').appendTo($moreButton);
$dropdownList = $('<ul class="dropdown-menu dropdown-menu-right dropdown-menu--more">').appendTo($moreButtonContainer);

Expand Down
1 change: 1 addition & 0 deletions Resources/views/Default/_js_footer.html.twig
Expand Up @@ -2,6 +2,7 @@

<script>
CKEDITOR_BASEPATH = '/bundles/kunstmaanadmin/default-theme/ckeditor/';
MORE_BUTTON_LABEL = '{{ 'kuma_js.auto_collapse.more_button_label' | trans | e('js') }}';
</script>

{% javascripts
Expand Down
3 changes: 2 additions & 1 deletion Resources/views/Form/fields.html.twig
Expand Up @@ -26,7 +26,8 @@
{% block choice_widget_collapsed %}
{% spaceless %}
{% set attr = attr|merge({ 'class': (attr.class|default('') ~ ' form-control')|trim }) %}
<select {{ block('widget_attributes') }}{% if multiple %} multiple="multiple"{% endif %}>
<select {{ block('widget_attributes') }}{% if multiple %} multiple="multiple"{% endif %}
{%- if attr.placeholder is defined %} data-placeholder="{{ attr.placeholder|trans({}, translation_domain) }}"{% endif %}>
{% if placeholder is not none %}
<option value="" {% if required and value is empty %}selected="selected"{% endif %}>{{ placeholder|trans({}, translation_domain) }}</option>
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions Resources/views/TabsTwigExtension/widget.html.twig
Expand Up @@ -10,7 +10,7 @@

<li {% if activeTab == tabIdentifier %} class="active" {% endif %}>
<a href="#{{ tabIdentifier }}" data-toggle="tab">
{{ tab.title }}
{{ tab.title|trans }}
{% if formErrors|length > 0 %}
<span class="error-label">
{{formErrors|length}}
Expand All @@ -21,7 +21,7 @@
{% endfor %}
<li class="tab__more dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
More <span class="caret"></span>
{{ 'form.button.dropdown.more' | trans }} <span class="caret"></span>
</a>
<ul class="dropdown-menu dropdown-menu-right" id="collapsed"></ul>
</li>
Expand Down

0 comments on commit a6d2d62

Please sign in to comment.