finish pages i18n
This commit is contained in:
parent
1a8c8537a4
commit
692c70d324
13 changed files with 144 additions and 86 deletions
|
@ -17,7 +17,7 @@ class PagesController < ApplicationController
|
|||
elsif params[:id]
|
||||
page = Page.find_by_id(params[:id])
|
||||
if page.nil?
|
||||
flash[:error] = "Seite existiert nicht!"
|
||||
flash[:error] = I18n.t('pages.cshow.error_noexist')
|
||||
redirect_to all_pages_path and return
|
||||
else
|
||||
redirect_to wiki_page_path(page.permalink) and return
|
||||
|
@ -29,7 +29,7 @@ class PagesController < ApplicationController
|
|||
elsif @page.redirect?
|
||||
page = Page.find_by_id(@page.redirect)
|
||||
unless page.nil?
|
||||
flash[:notice] = "Weitergeleitet von #{@page.title} ..."
|
||||
flash[:notice] = I18n.t('pages.cshow.redirect_notice', :page => @page.title)
|
||||
redirect_to wiki_page_path(page.permalink)
|
||||
end
|
||||
end
|
||||
|
@ -57,7 +57,7 @@ class PagesController < ApplicationController
|
|||
render :action => 'new'
|
||||
else
|
||||
if @page.save
|
||||
flash[:notice] = 'Seite wurde angelegt.'
|
||||
flash[:notice] = I18n.t('pages.create.notice')
|
||||
redirect_to(wiki_page_path(@page.permalink))
|
||||
else
|
||||
render :action => "new"
|
||||
|
@ -76,7 +76,7 @@ class PagesController < ApplicationController
|
|||
if @page.save
|
||||
@page.parent_id = parent_id if (!params[:parent_id].blank? \
|
||||
and params[:parent_id] != @page_id)
|
||||
flash[:notice] = 'Seite wurde aktualisiert.'
|
||||
flash[:notice] = I18n.t('pages.update.notice')
|
||||
redirect_to wiki_page_path(@page.permalink)
|
||||
else
|
||||
render :action => "edit"
|
||||
|
@ -84,7 +84,7 @@ class PagesController < ApplicationController
|
|||
end
|
||||
|
||||
rescue ActiveRecord::StaleObjectError
|
||||
flash[:error] = "Achtung, die Seite wurde gerade von jemand anderes bearbeitet. Bitte versuche es erneut."
|
||||
flash[:error] = I18n.t('pages.error_stale_object')
|
||||
redirect_to wiki_page_path(@page.permalink)
|
||||
end
|
||||
|
||||
|
@ -92,7 +92,7 @@ class PagesController < ApplicationController
|
|||
@page = Page.find(params[:id])
|
||||
@page.destroy
|
||||
|
||||
flash[:notice] = "Die Seite '#{@page.title}' und alle Unterseiten wurden erfolgreich gelöscht."
|
||||
flash[:notice] = I18n.t('pages.destroy.notice', :page => @page.title)
|
||||
redirect_to wiki_path
|
||||
end
|
||||
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
- unless toc.blank? or params[:preview]
|
||||
- content_for :sidebar do
|
||||
#wikitoc.well.well-small
|
||||
%h3 Inhalt
|
||||
%h3= t '.title_toc'
|
||||
= toc
|
||||
= content
|
||||
= content
|
||||
|
|
|
@ -11,85 +11,75 @@
|
|||
= f.input :parent_id, as: :select, collection: parent_pages_to_select(@page)
|
||||
.form-actions
|
||||
= button_tag :name => 'preview', class: 'btn' do
|
||||
%i.icon-search
|
||||
Vorschau
|
||||
%i.icon-search= t '.preview'
|
||||
= button_tag class: 'btn' do
|
||||
%i.icon-save
|
||||
Speichern
|
||||
= link_to "oder abbrechen", @page
|
||||
%i.icon-save= t 'ui.save'
|
||||
= link_to t('ui.or_cancel'), @page
|
||||
|
||||
.span4
|
||||
%h3 Schnelle Formatierungshilfe
|
||||
%h3= t '.help.title'
|
||||
%table.table
|
||||
%tbody
|
||||
%tr
|
||||
%td(colspan=2)
|
||||
%b Zeichenformatierung
|
||||
%b= t '.help.section_character'
|
||||
%tr
|
||||
%td
|
||||
%i kursiv
|
||||
%i= t '.help.italic'
|
||||
%td
|
||||
%pre
|
||||
''kursiv''<br />
|
||||
''#{t '.help.italic'}''<br />
|
||||
%tr
|
||||
%td
|
||||
%b fett
|
||||
%b= t '.help.bold'
|
||||
%td
|
||||
%pre '''Fett'''<br />
|
||||
%pre '''#{t '.help.bold'}'''<br />
|
||||
%tr
|
||||
%td= t '.help.noformat'
|
||||
%td
|
||||
Keine Wiki-<br/>Formatierung
|
||||
%td
|
||||
%pre <nowiki>text</nowiki>
|
||||
%pre <nowiki>#{t '.help.text'}</nowiki>
|
||||
%tr
|
||||
%td(colspan=2)
|
||||
%b Block-Formatierung
|
||||
%b= t '.help.section_block'
|
||||
%tr
|
||||
%td
|
||||
Überschriften
|
||||
%td= t '.help.headings'
|
||||
%td
|
||||
%pre
|
||||
\== Ebene 1 ==
|
||||
\== #{t '.help.heading', level: 1} ==
|
||||
%pre
|
||||
\=== Ebene 2 ===
|
||||
\=== #{t '.help.heading', level: 2} ===
|
||||
%pre
|
||||
\==== Ebene 3 ====
|
||||
\==== #{t '.help.heading', level: 3} ====
|
||||
%tr
|
||||
%td
|
||||
Listen mit Punkten
|
||||
%td= t '.help.unordered_list'
|
||||
%td
|
||||
%pre
|
||||
* Erster Punkt
|
||||
* #{t '.help.list_item_1'}
|
||||
%pre
|
||||
** Zweiter Punkt
|
||||
** #{t '.help_list_item_2'}
|
||||
%tr
|
||||
%td
|
||||
Listen mit Zahlen
|
||||
%td= t '.help.ordered_list'
|
||||
%td
|
||||
%pre
|
||||
\# Ersten Punkt
|
||||
\# #{t '.help.list_item_1'}
|
||||
%pre
|
||||
\# Zweiter Punkt
|
||||
\# #{t '.help.list_item_2'}
|
||||
%tr
|
||||
%td(colspan=2)
|
||||
%b Link-Formatierung
|
||||
%b= t '.help.section_link'
|
||||
%tr
|
||||
%td
|
||||
Wiki-Links
|
||||
%td= t '.help.wiki_links'
|
||||
%td
|
||||
%pre
|
||||
[[Foodsoft Wiki Seite]]
|
||||
[[#{t '.help.wiki_link_ex'}]]
|
||||
%tr
|
||||
%td
|
||||
Externe Links
|
||||
%td= t '.help.external_links'
|
||||
%td
|
||||
%pre
|
||||
[http://addresse.net Externe Seite]
|
||||
[http://example.net #{t '.help.external_link_ex'}]
|
||||
%tr
|
||||
%td(colspan=2)
|
||||
%b Tabellenformatierung
|
||||
%tr
|
||||
%td
|
||||
Siehe
|
||||
= link_to "Tabellen", "http://www.mediawiki.org/wiki/Help:Tables", :target => '_blank'
|
||||
%td!= t '.help.see_tables', tables_link: link_to(t('.help.tables_link'), "http://www.mediawiki.org/wiki/Help:Tables", :target => '_blank')
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
%tr
|
||||
%td{:style => "padding-left: #{ident}px"}
|
||||
= link_to page.title, wiki_page_path(page.permalink)
|
||||
%td #{page.user.try(:nick)} (#{format_datetime_timespec(page.updated_at, '%a, %d. %B %Y %H:%M:%S')})
|
||||
%td #{page.user.try(:nick)} (#{format_datetime_timespec(page.updated_at, t('.date_format'))})
|
||||
-if siteMap == 1
|
||||
-for child in page.children.all
|
||||
= render :partial => 'page_list_item', :locals => {:page => child, :level => level+1, :siteMap => 1}
|
||||
= render :partial => 'page_list_item', :locals => {:page => child, :level => level+1, :siteMap => 1}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th Titel
|
||||
%th Zuletzt aktualisiert
|
||||
%th= t 'pages.title'
|
||||
%th= t 'pages.last_updated'
|
||||
%tbody
|
||||
- for page in @pages
|
||||
= render :partial => "page_list_item", :locals => {:page => page, :level => 0, :siteMap => 0}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th Titel
|
||||
%th Zuletzt aktualisiert
|
||||
%th= t 'pages.title'
|
||||
%th= t 'pages.last_updated'
|
||||
- homepage = Page.find_by_permalink('Home')
|
||||
- unless homepage.nil?
|
||||
= render :partial => 'page_list_item', :locals => {:page => homepage, :level => 0, :siteMap => 1}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th Titel
|
||||
%th Zuletzt aktualisiert
|
||||
%th= t 'pages.title'
|
||||
%th= t 'pages.last_updated'
|
||||
%tbody
|
||||
- for page in @pages
|
||||
= render :partial => "page_list_item", :locals => {:page => page, :level => 0, :siteMap => 0}
|
||||
= render :partial => "page_list_item", :locals => {:page => page, :level => 0, :siteMap => 0}
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
- title "Alle Wikiseiten", false
|
||||
- title t('.title'), false
|
||||
|
||||
- content_for :sidebar do
|
||||
= link_to "Neue Seite anlegen", new_page_path, class: 'btn btn-primary'
|
||||
= link_to t('.new_page'), new_page_path, class: 'btn btn-primary'
|
||||
|
||||
.navbar
|
||||
.navbar-inner
|
||||
%ul.nav
|
||||
%li= link_to 'Letzte Änderungen', all_pages_path(:view => 'recent_changes')
|
||||
%li= link_to 'Seiten-Liste', all_pages_path(:view => 'title_list')
|
||||
%li= link_to 'Site Map', all_pages_path(:view => 'site_map')
|
||||
%li= link_to t('.recent_changes'), all_pages_path(:view => 'recent_changes')
|
||||
%li= link_to t('.title_list'), all_pages_path(:view => 'title_list')
|
||||
%li= link_to t('.site_map'), all_pages_path(:view => 'site_map')
|
||||
= form_tag all_pages_path, method: :get, class: 'form-search pull-right' do
|
||||
= text_field_tag :name, params[:name], class: 'input-medium search-query',
|
||||
placeholder: 'Seitentitel ...'
|
||||
= submit_tag "Suche", class: 'btn'
|
||||
placeholder: t('.search.placeholder')
|
||||
= submit_tag t('.search.action'), class: 'btn'
|
||||
|
||||
= render @partial
|
||||
= render @partial
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
- title "Seite bearbeiten"
|
||||
- title t('.title')
|
||||
|
||||
= render 'form'
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
- title "Neue Wikiseite anlegen"
|
||||
- title t('.title')
|
||||
|
||||
= render 'form'
|
||||
|
|
|
@ -3,26 +3,25 @@
|
|||
- content_for :sidebar do
|
||||
%p
|
||||
= link_to edit_page_path(@page), class: 'btn btn-primary' do
|
||||
%i.icon-edit
|
||||
Seite bearbeiten
|
||||
%i.icon-edit= t '.edit'
|
||||
.well.well-small
|
||||
%ul.nav.nav-list
|
||||
%li
|
||||
%li= link_to "Versionen (#{@page.versions.count})", "#versions", 'data-toggle-this' => '#versions'
|
||||
%li= link_to t('.versions', count: @page.versions.count), "#versions", 'data-toggle-this' => '#versions'
|
||||
- unless @page.children.empty?
|
||||
%li= link_to "Unterseiten", "#subpages", 'data-toggle-this' => '#subpages'
|
||||
%li= link_to t('.subpages'), "#subpages", 'data-toggle-this' => '#subpages'
|
||||
|
||||
#versions.well.well-small{:style => "display:none"}
|
||||
%h3 Versionen
|
||||
%h3= t '.title_versions'
|
||||
%ul.unstyled
|
||||
- @page.versions.reverse.each do |version|
|
||||
%li
|
||||
= link_to I18n.l(version.updated_at, :format => "%d.%m.%y %H:%M"), version_page_path(@page, :version => version.lock_version)
|
||||
= link_to I18n.l(version.updated_at, :format => t('.date_format')), version_page_path(@page, :version => version.lock_version)
|
||||
= "(#{User.find_by_id(version.updated_by).try(:nick)})"
|
||||
|
||||
- unless @page.children.empty?
|
||||
#subpages.well.well-small{:style => "display:none"}
|
||||
%h3 Unterseiten
|
||||
%h3= t '.subpages'
|
||||
%ul.unstyled
|
||||
- @page.children.each do |page|
|
||||
%li= link_to_wikipage(page)
|
||||
|
@ -46,11 +45,7 @@
|
|||
%hr.clear/
|
||||
%p
|
||||
= link_to edit_page_path(@page), class: 'btn btn-primary' do
|
||||
%i.icon-edit
|
||||
Seite bearbeiten
|
||||
= link_to "Seite löschen", @page, class: 'btn btn-danger', :method => :delete,
|
||||
:confirm => "Achtung, auch alle Unterseiten werden gelöscht. Bist Du sicher?"
|
||||
| Zuletzt bearbeitet von
|
||||
%b
|
||||
= "#{@page.user.try(:nick)}"
|
||||
= "am #{format_datetime @page.updated_at}"
|
||||
%i.icon-edit= t '.edit'
|
||||
= link_to t('.delete'), @page, class: 'btn btn-danger', :method => :delete,
|
||||
:confirm => t('.delete_confirm')
|
||||
!= '| ' + t('.last_updated', user: h(@page.user.try(:nick)), when: format_datetime(@page.updated_at))
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
- title "#{@page.title} - Version #{@version.lock_version}"
|
||||
- title t('.title', title: @page.title, version: @version.lock_version)
|
||||
|
||||
- content_for :sidebar do
|
||||
%h3 Version
|
||||
%b= "#{format_datetime_timespec(@version.updated_at, "%a, %d.%m.%Y, %H:%M Uhr") }"
|
||||
%h3= t '.title_version'
|
||||
%b= "#{format_datetime_timespec(@version.updated_at, t('.date_format'))}"
|
||||
%ul
|
||||
%li= "Autor: #{User.find(@version.updated_by).nick}"
|
||||
%li= link_to "Aktuelle Version sehen", wiki_page_path(:permalink => @page.permalink)
|
||||
%li= link_to "Auf diese Version zurücksetzen", revert_page_path(@page, :version => @version.lock_version)
|
||||
%li= t '.author', user: User.find(@version.updated_by).nick
|
||||
%li= link_to t('.view_current'), wiki_page_path(:permalink => @page.permalink)
|
||||
%li= link_to t('.revert'), revert_page_path(@page, :version => @version.lock_version)
|
||||
|
||||
= wikified_body @version.body
|
||||
|
|
73
config/locales/de/de.pages.yml
Normal file
73
config/locales/de/de.pages.yml
Normal file
|
@ -0,0 +1,73 @@
|
|||
de:
|
||||
pages:
|
||||
title: 'Titel'
|
||||
last_updated: 'Zuletzt aktualisiert'
|
||||
all:
|
||||
title: 'Alle Wikiseiten'
|
||||
new_page: 'Neue Seite anlegen'
|
||||
recent_changes: 'Letzte Änderungen'
|
||||
title_list: 'Seiten-Liste'
|
||||
site_map: 'Site Map'
|
||||
search:
|
||||
placeholder: 'Seitentitle ...'
|
||||
action: 'Suche'
|
||||
body:
|
||||
title_toc: 'Inhalt'
|
||||
edit:
|
||||
title: 'Seite bearbeiten'
|
||||
form:
|
||||
preview: 'Vorschau'
|
||||
help:
|
||||
title: 'Schnelle Formatierungshilfe'
|
||||
section_character: 'Zeichenformatierung'
|
||||
italic: 'kursiv'
|
||||
bold: 'fett'
|
||||
noformat: 'Keine Wiki- Formatierung'
|
||||
text: 'text'
|
||||
section_block: 'Block-Formatierung'
|
||||
headings: 'Überschriften'
|
||||
heading: 'Ebene %{level}'
|
||||
unordered_list: 'Listen mit Punkten'
|
||||
list_item_1: 'Erster Punkt'
|
||||
list_item_2: 'Zweiter Punkt'
|
||||
ordered_list: 'Listen mit Zahlen'
|
||||
section_link: 'Link-Formatierung'
|
||||
wiki_links: 'Wiki-Links'
|
||||
wiki_link_ex: 'Foodsoft Wiki Seite'
|
||||
external_links: 'Externe Links'
|
||||
external_link_ex: 'Externe Seite'
|
||||
section_table: 'Tabellenformatierung'
|
||||
see_tables: 'Siehe %{tables_link}'
|
||||
tables_link: 'Tabellen'
|
||||
new:
|
||||
title: 'Neue Wikiseite anlegen'
|
||||
page_list_item:
|
||||
date_format: '%a, %d. %B %Y %H:%M:%S'
|
||||
show:
|
||||
edit: 'Seite bearbeiten'
|
||||
versions: 'Versionen (%{count})'
|
||||
subpages: 'Unterseiten'
|
||||
title_versions: 'Versionen'
|
||||
date_format: '%d.%m.%y %H:%M'
|
||||
delete: 'Seite löschen'
|
||||
delete_confirm: 'Achtung, auch alle Unterseiten werden gelöscht. Bist Du sicher?'
|
||||
last_updated: 'Zuletzt bearbeitet von <b>%{user}</b> am %{when}'
|
||||
version:
|
||||
title: '%{title} - Version %{version}'
|
||||
title_version: 'Version'
|
||||
date_format: '%a, %d.%m.%Y, %H:%M Uhr'
|
||||
author: 'Autor: %{user}'
|
||||
view_current: 'Aktuelle Version sehen'
|
||||
revert: 'Auf diese Version zurücksetzen'
|
||||
|
||||
# used by controller
|
||||
cshow:
|
||||
error_noexist: 'Seite existiert nicht!'
|
||||
redirect_notice: 'Weitergeleitet von %{page} ...'
|
||||
create:
|
||||
notice: 'Seite wurde angelegt'
|
||||
update:
|
||||
notice: 'Seite wurde aktualisiert'
|
||||
destroy:
|
||||
notice: "Die Seite '%{page}' und alle Unterseiten wurden erfolgreich gelöscht"
|
||||
error_stale_object: 'Achtung, die Seite wurde gerade von jemand anderes bearbeitet. Bitte versuche es erneut.'
|
Loading…
Reference in a new issue