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

add tap:i18n and spanish translation #168

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions export-i18n.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#! sh
xgettext-template -D lib/client/html -L Handlebars *.html -o i18n/en.i18n.po
i18next-conv -l en -s i18n/en.i18n.po -t i18n/en.i18n.json
28 changes: 28 additions & 0 deletions i18n/en.i18n.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"Admin": "",
"Toggle navigation": "",
"Home": "",
"Your profile": "",
"Sign out": "",
"Dashboard": "",
"New": "",
"Edit": "",
"Confirm delete": "",
"Are you sure you want to delete this?": "",
"You need to be an admin to view this page": "",
"You need to define an AdminConfig object to use the admin dashboard.": "",
"A basic config to manage the 'Posts' and 'Comments' collection would look like this:": "",
"View All": "",
"There are no visible items in this collection.": "",
"Add one": "",
"Add User": "",
"Click a role to toggle it.": "",
"User not in any roles. Click a role to add it to a user.": "",
"Reset Password": "",
"Send a reset password email to": "",
"Send Email": "",
"Change Password": "",
"ID": "",
"Delete": "",
"See all": ""
}
114 changes: 114 additions & 0 deletions i18n/en.i18n.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
msgid ""
msgstr "Content-Type: text/plain;\n"

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_header.html:7
msgid "Admin"
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_header.html:13
msgid "Toggle navigation"
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_header.html:22
#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_header.html:24
#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_header.html:30
msgid "Home"
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_header.html:35
msgid "Your profile"
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_header.html:39
msgid "Sign out"
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_layouts.html:18
#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_sidebar.html:19
msgid "Dashboard"
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_layouts.html:24
#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_sidebar.html:30
msgid "New"
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_layouts.html:28
#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_templates.html:145
msgid "Edit"
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_layouts.html:61
msgid "Confirm delete"
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_layouts.html:64
msgid "Are you sure you want to delete this?"
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_layouts.html:80
msgid "You need to be an admin to view this page"
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_layouts.html:89
msgid "You need to define an AdminConfig object to use the admin dashboard."
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_layouts.html:91
msgid ""
"A basic config to manage the 'Posts' and 'Comments' collection would look "
"like this:"
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_sidebar.html:31
msgid "View All"
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_templates.html:49
msgid "There are no visible items in this collection."
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_templates.html:50
msgid "Add one"
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_templates.html:70
msgid "Add User"
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_templates.html:91
msgid "Click a role to toggle it."
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_templates.html:93
msgid "User not in any roles. Click a role to add it to a user."
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_templates.html:97
msgid "Reset Password"
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_templates.html:104
msgid "Send a reset password email to"
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_templates.html:105
msgid "Send Email"
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_templates.html:109
#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_templates.html:117
msgid "Change Password"
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_templates.html:112
msgid "ID"
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_templates.html:150
msgid "Delete"
msgstr ""

#: /home/xaiki/src/enre/gaz/packages/yogiben:admin/lib/client/html/admin_widgets.html:26
msgid "See all"
msgstr ""
28 changes: 28 additions & 0 deletions i18n/es.i18n.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"Admin": "Administrador",
"Toggle navigation": "",
"Home": "Inicio",
"Your profile": "Su Perfil",
"Sign out": "Desconectarse",
"Dashboard": "Panel de Control",
"New": "Nuevo",
"Edit": "Editar",
"Confirm delete": "Confirme la supresion",
"Are you sure you want to delete this?": "¿ Esta seguro que quiere suprimir esto ?",
"You need to be an admin to view this page": "Necesita privilegios de administrador para ver esta pagina",
"You need to define an AdminConfig object to use the admin dashboard.": "Necesita definir un objeto 'AdminConfig' para utilizar este panel de control de administrador",
"A basic config to manage the 'Posts' and 'Comments' collection would look like this:": "",
"View All": "Una configuración basica para controlar las colecciones 'Posts' y 'Comments' se veria algo asi:",
"There are no visible items in this collection.": "No hay elementos visibles en esta coleccion",
"Add one": "Agregar uno",
"Add User": "Agregar Usuario",
"Click a role to toggle it.": "Haga click en un rol para activarlo",
"User not in any roles. Click a role to add it to a user.": "Este usuario no esta en ningun rol. Haga click sobre un rol para agregarlo a un usuario",
"Reset Password": "Resetear la Clave",
"Send a reset password email to": "Mandar una petición de reset de clave por email a",
"Send Email": "Mandar Email",
"Change Password": "Cambiar la clave",
"ID": "ID",
"Delete": "Suprimir",
"See all": "Ver todos"
}
8 changes: 4 additions & 4 deletions lib/both/AdminDashboard.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ AdminDashboard =
AdminDashboard.schemas.newUser = new SimpleSchema
email:
type: String
label: "Email address"
label: __ "Email address"
chooseOwnPassword:
type: Boolean
label: 'Let this user choose their own password with an email'
label: __ 'Let this user choose their own password with an email'
defaultValue: true
password:
type: String
label: 'Password'
label: __ 'Password'
optional: true
sendPassword:
type: Boolean
label: 'Send this user their password by email'
label: __ 'Send this user their password by email'
optional: true

AdminDashboard.schemas.sendResetPasswordEmail = new SimpleSchema
Expand Down
24 changes: 12 additions & 12 deletions lib/both/router.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
Meteor.call 'adminCheckAdmin'
if typeof AdminConfig?.nonAdminRedirectRoute == 'string'
Router.go AdminConfig.nonAdminRedirectRoute

@next()


Expand All @@ -32,7 +32,7 @@ Router.route "adminDashboard",
action: ->
@render()
onAfterAction: ->
Session.set 'admin_title', 'Dashboard'
Session.set 'admin_title', __ 'Dashboard'
Session.set 'admin_collection_name', ''
Session.set 'admin_collection_page', ''

Expand All @@ -43,10 +43,10 @@ Router.route "adminDashboardUsersNew",
action: ->
@render()
onAfterAction: ->
Session.set 'admin_title', 'Users'
Session.set 'admin_subtitle', 'Create new user'
Session.set 'admin_collection_page', 'New'
Session.set 'admin_collection_name', 'Users'
Session.set 'admin_title', __ 'Users'
Session.set 'admin_subtitle', __ 'Create new user'
Session.set 'admin_collection_page', __ 'New'
Session.set 'admin_collection_name', __ 'Users'

Router.route "adminDashboardUsersEdit",
path: "/admin/Users/:_id/edit"
Expand Down Expand Up @@ -76,7 +76,7 @@ Router.route "adminDashboardView",
@render()
onAfterAction: ->
Session.set 'admin_title', @params.collection
Session.set 'admin_subtitle', 'View'
Session.set 'admin_subtitle', __ 'View'
Session.set 'admin_collection_name', @params.collection

Router.route "adminDashboardNew",
Expand All @@ -87,8 +87,8 @@ Router.route "adminDashboardNew",
@render()
onAfterAction: ->
Session.set 'admin_title', AdminDashboard.collectionLabel(@params.collection)
Session.set 'admin_subtitle', 'Create new'
Session.set 'admin_collection_page', 'new'
Session.set 'admin_subtitle', __ 'Create new'
Session.set 'admin_collection_page', __ 'new'
Session.set 'admin_collection_name', @params.collection.charAt(0).toUpperCase() + @params.collection.slice(1)
data: ->
admin_collection: adminCollectionObject @params.collection
Expand All @@ -103,10 +103,10 @@ Router.route "adminDashboardEdit",
@render()
onAfterAction: ->
Session.set 'admin_title', AdminDashboard.collectionLabel @params.collection
Session.set 'admin_subtitle', 'Edit ' + @params._id
Session.set 'admin_collection_page', 'edit'
Session.set 'admin_subtitle', __ 'Edit ' + @params._id
Session.set 'admin_collection_page', __ 'edit'
Session.set 'admin_collection_name', @params.collection.charAt(0).toUpperCase() + @params.collection.slice(1)
Session.set 'admin_id', @params._id
Session.set 'admin_doc', adminCollectionObject(@params.collection).findOne _id : @params._id
data: ->
admin_collection: adminCollectionObject @params.collection
admin_collection: adminCollectionObject @params.collection
14 changes: 7 additions & 7 deletions lib/both/startup.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ adminTablesDom = '<"box"<"box-header"<"box-toolbar"<"pull-left"<lf>><"pull-right
adminEditDelButtons = [
{
data: '_id'
title: 'Edit'
title: __ 'Edit'
createdCell: (node, cellData, rowData) ->
$(node).html(Blaze.toHTMLWithData Template.adminEditBtn, {_id: cellData}, node)
width: '40px'
orderable: false
}
{
data: '_id'
title: 'Delete'
title: __ 'Delete'
createdCell: (node, cellData, rowData) ->
$(node).html(Blaze.toHTMLWithData Template.adminDeleteBtn, {_id: cellData}, node)
width: '40px'
Expand All @@ -26,32 +26,32 @@ defaultColumns = [
]

AdminTables.Users = new Tabular.Table
name: 'Users'
name: __ 'Users'
collection: Meteor.users
columns: _.union [
{
data: '_id'
title: 'Admin'
title: __ 'Admin'
# TODO: use `tmpl`
createdCell: (node, cellData, rowData) ->
$(node).html(Blaze.toHTMLWithData Template.adminUsersIsAdmin, {_id: cellData}, node)
width: '40px'
}
{
data: 'emails'
title: 'Email'
title: __ 'Email'
render: (value) ->
value[0].address
}
{
data: 'emails'
title: 'Mail'
title: __ 'Mail'
# TODO: use `tmpl`
createdCell: (node, cellData, rowData) ->
$(node).html(Blaze.toHTMLWithData Template.adminUsersMailBtn, {emails: cellData}, node)
width: '40px'
}
{ data: 'createdAt', title: 'Joined' }
{ data: 'createdAt', title: __ 'Joined' }
], adminEditDelButtons
dom: adminTablesDom

Expand Down
4 changes: 2 additions & 2 deletions lib/both/utils.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
arr = obj.split '.'
continue while arr.length and (ref = ref[arr.shift()])
if not ref and required
throw new Error(obj + ' is not in the ' + root.toString())
throw new Error(obj + __ (' is not in the ') + root.toString())
else
return ref
return obj
return obj
16 changes: 8 additions & 8 deletions lib/client/html/admin_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
{{#if AdminConfig.name}}
{{AdminConfig.name}}
{{else}}
Admin
{{_ "Admin"}}
{{/if}}
</a>
<nav class="navbar navbar-static-top" role="navigation">
<!-- Sidebar toggle button-->
<a href="#" class="navbar-btn sidebar-toggle" data-toggle="offcanvas" role="button">
<span class="sr-only">Toggle navigation</span>
<span class="sr-only">{{_ "Toggle navigation"}}</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
Expand All @@ -19,24 +19,24 @@
<ul class="nav navbar-nav">
<li>
{{#if AdminConfig.dashboard.homeUrl}}
<a href="{{AdminConfig.dashboard.homeUrl}}">Home</a>
<a href="{{AdminConfig.dashboard.homeUrl}}">{{_ "Home"}}</a>
{{else}}
<a href="/">Home</a>
<a href="/">{{_ "Home"}}</a>
{{/if}}

</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span>Admin<i class="caret"></i></span>
<span>{{_ "Home"}}<i class="caret"></i></span>
</a>
<ul class="dropdown-menu">
<li class="">
<a href="{{pathFor 'adminDashboardUsersEdit' _id=currentUser._id}}">
Your profile
{{_ "Your profile"}}
</a>
</li>
<li class="">
<a href="#" class="btn-sign-out">Sign out
<a href="#" class="btn-sign-out">{{_ "Sign out"}}
</a>
</li>
</ul>
Expand All @@ -45,4 +45,4 @@
</div>
</nav>
</header>
</template>
</template>
Loading