Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localize submenu buttons #1689

Merged
merged 5 commits into from
Aug 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions assets/js/app/sidebar/Components/Menu/_SubMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<li v-if="item.link_new !== null" class="link--actions">
<a :href="item.link_new" data-patience="virtue">
<i class="fas fa-fw fa-magic mr-2"></i
><span>New {{ item.singular_name }}</span>
><span>{{ labels['action.new'] }}</span>
</a>
<a :href="item.link_listing" data-patience="virtue">
<i class="fas fa-fw" :class="item.icon"></i>
<span>View {{ item.name }}</span>
<span>{{ labels['action.view'] }} {{ item.name }}</span>
</a>
</li>
<!-- eslint-disable vue/no-use-v-if-with-v-for -->
Expand All @@ -32,6 +32,7 @@ export default {
name: 'SubMenu',
props: {
item: Object,
labels: Object,
},
};
</script>
3 changes: 2 additions & 1 deletion assets/js/app/sidebar/Components/Menu/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
><span class="link--text">{{ item.name }}</span>
<template v-if="item.submenu !== null">
<i class="fas fa-caret-right link--caret"></i>
<sub-menu :item="item"></sub-menu>
<sub-menu :item="item" :labels="labels"></sub-menu>
</template>
</a>
</li>
Expand All @@ -39,6 +39,7 @@ export default {
},
props: {
menu: Array,
labels: Object,
},
methods: {
singleton(item) {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/app/sidebar/Components/Sidebar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<nav class="admin__sidebar--nav">
<sidebar-menu :menu="menu"></sidebar-menu>
<sidebar-menu :menu="menu" :labels="labels"></sidebar-menu>
<sidebar-toggler
:version="version"
:about-link="aboutLink"
Expand Down
9 changes: 7 additions & 2 deletions templates/_base/layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{# Setting the labels and their localisations that are used in the sidebar-menu. #}
{% set labels = {
'about.bolt_documentation': 'about.bolt_documentation'|trans,
'action.view_site': 'action.view'|trans,
'action.view_site': 'action.view_site'|trans,
'action.create_new': 'action.create_new'|trans,
'general.greeting': 'general.greeting'|trans({'%name%': user_display_name}),
'action.logout': 'action.logout'|trans,
Expand Down Expand Up @@ -70,13 +70,18 @@
<!-- End Admin Header -->

<!-- Admin Sidebar -->
{% set labels = {
'toggler': 'admin_sidebar.toggler'|trans,
'action.new': 'action.new'|trans,
'action.view': 'action.view'|trans,
}|json_encode %}
<div class="admin__sidebar">
<div class="sidebar sidebar--sticky" id="sidebar">
<admin-sidebar
:menu="{{ admin_menu_json }}"
:version="'{{ constant('Bolt\\Version::VERSION')|replace({'alpha': 'α', 'beta': 'β'}) }}'"
:about-link="{{ path('bolt_about')|json_encode }}"
:labels="{{ { 'toggler': 'admin_sidebar.toggler'|trans }|json_encode }}"
:labels="{{ labels }}"
></admin-sidebar >
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/edit_record_1.feature
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ Feature: Edit record
And I am on "/bolt"

When I hover over the "Tests" element
And I follow "New Test"
And I click the 5th "New"

Then I should be on "/bolt/new/tests"

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/record_listing.feature
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Feature: Record listing

When I hover over the "Tests" element
Then I should see 6 "li" in the 4th ".admin__sidebar--menu ul"
And I should see "New test" in the "#sidebar ul li:nth-child(8) ul > li:nth-child(1) > a" element
And I should see "New" in the "#sidebar ul li:nth-child(8) ul > li:nth-child(1) > a" element
And I should see "Title of the test" in the "#sidebar ul li:nth-child(8) ul > li:nth-child(2) > a" element

@javascript
Expand Down
20 changes: 13 additions & 7 deletions translations/messages.en.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1083,12 +1083,6 @@
<target>File updated succesfully!</target>
</segment>
</unit>
<unit id="eq5YMQf" name="9fb3e6e">
<segment>
<source>This website is &lt;a href='%url%' target='_blank' title='Sophisticated, lightweight &amp; simple CMS'&gt;Built with Bolt&lt;/a&gt;.</source>
<target><![CDATA[This website is <a href='%url%' target='_blank' title='Sophisticated, lightweight & simple CMS'>Built with Bolt</a>.]]></target>
</segment>
</unit>
<unit id="3zlZmRK" name="action.add_user">
<segment>
<source>action.add_user</source>
Expand Down Expand Up @@ -1122,7 +1116,7 @@
<unit id="TtmWqX3" name="action.view">
<segment>
<source>action.view</source>
<target>View website</target>
<target>View</target>
</segment>
</unit>
<unit id="I2ykiIZ" name="caption.folders">
Expand Down Expand Up @@ -2331,5 +2325,17 @@
<target><![CDATA[All content, filtered by <em>'%filter%'</em>.]]></target>
</segment>
</unit>
<unit id="GPd6Hap" name="action.view_site">
<segment>
<source>action.view_site</source>
<target>View website</target>
</segment>
</unit>
<unit id="f.rvF6y" name="action.new">
<segment>
<source>action.new</source>
<target>New</target>
</segment>
</unit>
</file>
</xliff>
84 changes: 42 additions & 42 deletions translations/validators.en.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
<target>The value you selected is not a valid choice.</target>
</segment>
</unit>
<unit id="u81CkP8" name="0d999f2">
<unit id="7smtimf" name="0d999f2">
<segment>
<source>You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices.</source>
<source>0d999f2</source>
<target>You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices.</target>
</segment>
</unit>
<unit id="nIvOQ_o" name="0824486">
<unit id="JRlXq2Z" name="0824486">
<segment>
<source>You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices.</source>
<source>0824486</source>
<target>You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices.</target>
</segment>
</unit>
Expand Down Expand Up @@ -91,15 +91,15 @@
<target>The file is not readable.</target>
</segment>
</unit>
<unit id="JocOVM2" name="1ad411a">
<unit id="2O3FbJ6" name="1ad411a">
<segment>
<source>The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}.</source>
<source>1ad411a</source>
<target>The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}.</target>
</segment>
</unit>
<unit id="YW21SPH" name="30a318d">
<unit id="p4L.BFV" name="30a318d">
<segment>
<source>The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.</source>
<source>30a318d</source>
<target>The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.</target>
</segment>
</unit>
Expand All @@ -109,9 +109,9 @@
<target>This value should be {{ limit }} or less.</target>
</segment>
</unit>
<unit id="HX7TOFm" name="0e0c1e1">
<unit id="SjJg9Hy" name="0e0c1e1">
<segment>
<source>This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less.</source>
<source>0e0c1e1</source>
<target>This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less.</target>
</segment>
</unit>
Expand All @@ -121,9 +121,9 @@
<target>This value should be {{ limit }} or more.</target>
</segment>
</unit>
<unit id="ekfrU.c" name="5188ff9">
<unit id="JJVWzKj" name="5188ff9">
<segment>
<source>This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.</source>
<source>5188ff9</source>
<target>This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.</target>
</segment>
</unit>
Expand Down Expand Up @@ -235,27 +235,27 @@
<target>The size of the image could not be detected.</target>
</segment>
</unit>
<unit id="zVtJJEa" name="266051e">
<unit id="g9NoIBz" name="266051e">
<segment>
<source>The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px.</source>
<source>266051e</source>
<target>The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px.</target>
</segment>
</unit>
<unit id="s8LFQGC" name="c1c23f9">
<unit id="HTsQNva" name="c1c23f9">
<segment>
<source>The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px.</source>
<source>c1c23f9</source>
<target>The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px.</target>
</segment>
</unit>
<unit id="Z.NgqFj" name="9a128f7">
<unit id="h3PRqha" name="9a128f7">
<segment>
<source>The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px.</source>
<source>9a128f7</source>
<target>The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px.</target>
</segment>
</unit>
<unit id="AW1lWVM" name="8a4cd70">
<unit id="IVraZ3b" name="8a4cd70">
<segment>
<source>The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px.</source>
<source>8a4cd70</source>
<target>The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px.</target>
</segment>
</unit>
Expand All @@ -265,9 +265,9 @@
<target>This value should be the user's current password.</target>
</segment>
</unit>
<unit id="gYImVyV" name="fd389d6">
<unit id="Anek_FY" name="fd389d6">
<segment>
<source>This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters.</source>
<source>fd389d6</source>
<target>This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters.</target>
</segment>
</unit>
Expand Down Expand Up @@ -301,21 +301,21 @@
<target>A PHP extension caused the upload to fail.</target>
</segment>
</unit>
<unit id="gTJYRl6" name="b54c218">
<unit id="YuLxmhd" name="b54c218">
<segment>
<source>This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more.</source>
<source>b54c218</source>
<target>This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more.</target>
</segment>
</unit>
<unit id="FFn3lVn" name="949632c">
<unit id="qXV2OMI" name="949632c">
<segment>
<source>This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less.</source>
<source>949632c</source>
<target>This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less.</target>
</segment>
</unit>
<unit id="bSdilZv" name="e0582dc">
<unit id="BnjGMFh" name="e0582dc">
<segment>
<source>This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements.</source>
<source>e0582dc</source>
<target>This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements.</target>
</segment>
</unit>
Expand Down Expand Up @@ -385,9 +385,9 @@
<target>This value should be greater than or equal to {{ compared_value }}.</target>
</segment>
</unit>
<unit id="bOF1fpm" name="9670078">
<unit id="SreIWoo" name="9670078">
<segment>
<source>This value should be identical to {{ compared_value_type }} {{ compared_value }}.</source>
<source>9670078</source>
<target>This value should be identical to {{ compared_value_type }} {{ compared_value }}.</target>
</segment>
</unit>
Expand All @@ -409,21 +409,21 @@
<target>This value should not be equal to {{ compared_value }}.</target>
</segment>
</unit>
<unit id="Bi22JLt" name="0eedf91">
<unit id="JIjdvtb" name="0eedf91">
<segment>
<source>This value should not be identical to {{ compared_value_type }} {{ compared_value }}.</source>
<source>0eedf91</source>
<target>This value should not be identical to {{ compared_value_type }} {{ compared_value }}.</target>
</segment>
</unit>
<unit id="VczCWzQ" name="9c3ad0f">
<unit id="vzvxzpR" name="9c3ad0f">
<segment>
<source>The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}.</source>
<source>9c3ad0f</source>
<target>The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}.</target>
</segment>
</unit>
<unit id="v57PXhq" name="4376d45">
<unit id="LiDaIWN" name="4376d45">
<segment>
<source>The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}.</source>
<source>4376d45</source>
<target>The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}.</target>
</segment>
</unit>
Expand All @@ -433,15 +433,15 @@
<target>The image is square ({{ width }}x{{ height }}px). Square images are not allowed.</target>
</segment>
</unit>
<unit id="G_lu2qW" name="1dc128a">
<unit id="501jWTO" name="1dc128a">
<segment>
<source>The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed.</source>
<source>1dc128a</source>
<target>The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed.</target>
</segment>
</unit>
<unit id="sFyGx4B" name="9e27714">
<unit id="J4L.QnM" name="9e27714">
<segment>
<source>The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed.</source>
<source>9e27714</source>
<target>The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed.</target>
</segment>
</unit>
Expand Down Expand Up @@ -535,9 +535,9 @@
<target>This value is not a valid timezone.</target>
</segment>
</unit>
<unit id="40dnsod" name="7e27e92">
<unit id="A3Gr4fn" name="7e27e92">
<segment>
<source>This password has been leaked in a data breach, it must not be used. Please use another password.</source>
<source>7e27e92</source>
<target>This password has been leaked in a data breach, it must not be used. Please use another password.</target>
</segment>
</unit>
Expand Down