mirror of
https://github.com/projekteuler/projekteuler.git
synced 2025-12-10 08:46:41 +01:00
commit
e3f7a6538b
@ -25,7 +25,7 @@ class TranslationsController < ApplicationController
|
|||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @translation.save
|
if @translation.save
|
||||||
format.html { redirect_to @translation, notice: 'Translation was successfully created.' }
|
format.html { redirect_to @translation, notice: t('translations.notice.successfully_created') }
|
||||||
format.json { render :show, status: :created, location: @translation }
|
format.json { render :show, status: :created, location: @translation }
|
||||||
else
|
else
|
||||||
format.html { render :new }
|
format.html { render :new }
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Projekt Euler</title>
|
<title><%= t :site_title %></title>
|
||||||
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
|
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
|
||||||
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
||||||
<%= csrf_meta_tags %>
|
<%= csrf_meta_tags %>
|
||||||
@ -9,12 +9,12 @@
|
|||||||
<body>
|
<body>
|
||||||
<%= navbar position: :static do %>
|
<%= navbar position: :static do %>
|
||||||
<%= vertical do %>
|
<%= vertical do %>
|
||||||
<%= link_to 'Projekt Euler', root_path %>
|
<%= link_to t(:site_title), root_path %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= horizontal do %>
|
<%= horizontal do %>
|
||||||
<%= nav class: 'navbar-left' do %>
|
<%= nav class: 'navbar-left' do %>
|
||||||
<%= link_to 'Problems', problems_path %>
|
<%= link_to Problem.model_name.human(count: 2), problems_path %>
|
||||||
<%= link_to 'Translations', translations_path %>
|
<%= link_to Translation.model_name.human(count: 2), translations_path %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
<h1>Listing Problems</h1>
|
<h1><%= Problem.model_name.human(count: 2) %></h1>
|
||||||
|
|
||||||
<%= render 'problem_pagination' %>
|
<%= render 'problem_pagination' %>
|
||||||
<table class="table table-striped table-bordered">
|
<table class="table table-striped table-bordered">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th><%= Problem.human_attribute_name(:id) %></th>
|
||||||
<th>Title</th>
|
<th><%= Problem.human_attribute_name(:title) %></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
@ -17,9 +17,9 @@
|
|||||||
<% if problem.is_translated? %>
|
<% if problem.is_translated? %>
|
||||||
<%= link_to problem.title, problem %>
|
<%= link_to problem.title, problem %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<i>Dieses Problem wurde noch nicht übersetzt.</i>
|
<i><%= t 'problems.not_yet_translated' %></i>
|
||||||
<%= link_to new_problem_translation_path(problem), class: 'btn btn-default btn-xs' do %>
|
<%= link_to new_problem_translation_path(problem), class: 'btn btn-default btn-xs' do %>
|
||||||
<%= icon :pencil %> Übersetzung vorschlagen
|
<%= icon :pencil %> <%= t '.suggest_translation' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|||||||
@ -3,10 +3,10 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h1><%= @problem.title %> <small>Problem <%= @problem.id %></small></h1>
|
<h1><%= @problem.title %> <small><%= t '.problem_subtitle', id: @problem.id %></small></h1>
|
||||||
</div>
|
</div>
|
||||||
<%= link_to new_problem_translation_path(@problem), class: 'btn btn-default btn-sm pull-right' do %>
|
<%= link_to new_problem_translation_path(@problem), class: 'btn btn-default btn-sm pull-right' do %>
|
||||||
<%= icon :pencil %> Übersetzung verbessern
|
<%= icon :pencil %> <%= t '.improve_translation' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= panel do %>
|
<%= panel do %>
|
||||||
<div class="panel-body problem-content">
|
<div class="panel-body problem-content">
|
||||||
@ -14,5 +14,5 @@
|
|||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<%= link_to 'Dieses Problem auf projecteuler.net', @problem.original_url, target: '_blank' %>
|
<%= link_to t('.view_original_problem'), @problem.original_url, target: '_blank' %>
|
||||||
</div>
|
</div>
|
||||||
@ -1 +1 @@
|
|||||||
Dieses Problem wurde noch nicht übersetzt.
|
<%= t 'problems.not_yet_translated' %>
|
||||||
@ -1,7 +1,7 @@
|
|||||||
<%= form_for([@problem, @translation]) do |f| %>
|
<%= form_for([@problem, @translation]) do |f| %>
|
||||||
<% if @translation.errors.any? %>
|
<% if @translation.errors.any? %>
|
||||||
<div id="error_explanation">
|
<div id="error_explanation">
|
||||||
<h2><%= pluralize(@translation.errors.count, "error") %> prohibited this problem from being saved:</h2>
|
<h2><%= t 'errors.template.header', model: Translation.model_name.human, count: @translation.errors.count %></h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<% @translation.errors.full_messages.each do |message| %>
|
<% @translation.errors.full_messages.each do |message| %>
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
<h1>Listing translations</h1>
|
<h1><%= Translation.model_name.human(count: 2) %></h1>
|
||||||
|
|
||||||
<%= render 'translation_pagination' %>
|
<%= render 'translation_pagination' %>
|
||||||
<table class="table table-striped table-bordered">
|
<table class="table table-striped table-bordered">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th><%= Translation.human_attribute_name(:id) %></th>
|
||||||
<th>Title</th>
|
<th><%= Translation.human_attribute_name(:title) %></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<h1>New translation for problem <%= @problem.id %></h1>
|
<h1><%= t '.new_translation', id: @problem.id %></h1>
|
||||||
|
|
||||||
<%= render 'form' %>
|
<%= render 'form' %>
|
||||||
|
|
||||||
<%= link_to 'Back', translations_path %>
|
<%= link_to t('.back'), translations_path %>
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h1><%= @translation.title %> <small>Problem <%= @translation.problem_id %></small></h1>
|
<h1><%= @translation.title %> <small><%= t 'problems.show.problem_subtitle', id: @translation.problem_id %></small></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= panel do %>
|
<%= panel do %>
|
||||||
@ -12,5 +12,5 @@
|
|||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<%= link_to 'Dieses Problem auf projecteuler.net', @translation.problem.original_url, target: '_blank' %>
|
<%= link_to t('problems.show.view_original_problem'), @translation.problem.original_url, target: '_blank' %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -17,7 +17,8 @@ module Projekteuler
|
|||||||
# config.time_zone = 'Central Time (US & Canada)'
|
# config.time_zone = 'Central Time (US & Canada)'
|
||||||
|
|
||||||
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
||||||
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s]
|
||||||
# config.i18n.default_locale = :de
|
config.i18n.available_locales = :de
|
||||||
|
config.i18n.default_locale = :de
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -33,5 +33,5 @@ Rails.application.configure do
|
|||||||
config.assets.raise_runtime_errors = true
|
config.assets.raise_runtime_errors = true
|
||||||
|
|
||||||
# Raises error for missing translations
|
# Raises error for missing translations
|
||||||
# config.action_view.raise_on_missing_translations = true
|
config.action_view.raise_on_missing_translations = true
|
||||||
end
|
end
|
||||||
|
|||||||
@ -35,5 +35,5 @@ Rails.application.configure do
|
|||||||
config.active_support.deprecation = :stderr
|
config.active_support.deprecation = :stderr
|
||||||
|
|
||||||
# Raises error for missing translations
|
# Raises error for missing translations
|
||||||
# config.action_view.raise_on_missing_translations = true
|
config.action_view.raise_on_missing_translations = true
|
||||||
end
|
end
|
||||||
|
|||||||
205
config/locales/de.yml
Normal file
205
config/locales/de.yml
Normal file
@ -0,0 +1,205 @@
|
|||||||
|
---
|
||||||
|
de:
|
||||||
|
site_title: Projekt Euler
|
||||||
|
date:
|
||||||
|
abbr_day_names:
|
||||||
|
- So
|
||||||
|
- Mo
|
||||||
|
- Di
|
||||||
|
- Mi
|
||||||
|
- Do
|
||||||
|
- Fr
|
||||||
|
- Sa
|
||||||
|
abbr_month_names:
|
||||||
|
-
|
||||||
|
- Jan
|
||||||
|
- Feb
|
||||||
|
- Mär
|
||||||
|
- Apr
|
||||||
|
- Mai
|
||||||
|
- Jun
|
||||||
|
- Jul
|
||||||
|
- Aug
|
||||||
|
- Sep
|
||||||
|
- Okt
|
||||||
|
- Nov
|
||||||
|
- Dez
|
||||||
|
day_names:
|
||||||
|
- Sonntag
|
||||||
|
- Montag
|
||||||
|
- Dienstag
|
||||||
|
- Mittwoch
|
||||||
|
- Donnerstag
|
||||||
|
- Freitag
|
||||||
|
- Samstag
|
||||||
|
formats:
|
||||||
|
default: '%d.%m.%Y'
|
||||||
|
long: '%e. %B %Y'
|
||||||
|
short: '%e. %b'
|
||||||
|
month_names:
|
||||||
|
-
|
||||||
|
- Januar
|
||||||
|
- Februar
|
||||||
|
- März
|
||||||
|
- April
|
||||||
|
- Mai
|
||||||
|
- Juni
|
||||||
|
- Juli
|
||||||
|
- August
|
||||||
|
- September
|
||||||
|
- Oktober
|
||||||
|
- November
|
||||||
|
- Dezember
|
||||||
|
order:
|
||||||
|
- :day
|
||||||
|
- :month
|
||||||
|
- :year
|
||||||
|
datetime:
|
||||||
|
distance_in_words:
|
||||||
|
about_x_hours:
|
||||||
|
one: etwa eine Stunde
|
||||||
|
other: etwa %{count} Stunden
|
||||||
|
about_x_months:
|
||||||
|
one: etwa ein Monat
|
||||||
|
other: etwa %{count} Monate
|
||||||
|
about_x_years:
|
||||||
|
one: etwa ein Jahr
|
||||||
|
other: etwa %{count} Jahre
|
||||||
|
almost_x_years:
|
||||||
|
one: fast ein Jahr
|
||||||
|
other: fast %{count} Jahre
|
||||||
|
half_a_minute: eine halbe Minute
|
||||||
|
less_than_x_minutes:
|
||||||
|
one: weniger als eine Minute
|
||||||
|
other: weniger als %{count} Minuten
|
||||||
|
less_than_x_seconds:
|
||||||
|
one: weniger als eine Sekunde
|
||||||
|
other: weniger als %{count} Sekunden
|
||||||
|
over_x_years:
|
||||||
|
one: mehr als ein Jahr
|
||||||
|
other: mehr als %{count} Jahre
|
||||||
|
x_days:
|
||||||
|
one: ein Tag
|
||||||
|
other: '%{count} Tage'
|
||||||
|
x_minutes:
|
||||||
|
one: eine Minute
|
||||||
|
other: '%{count} Minuten'
|
||||||
|
x_months:
|
||||||
|
one: ein Monat
|
||||||
|
other: '%{count} Monate'
|
||||||
|
x_seconds:
|
||||||
|
one: eine Sekunde
|
||||||
|
other: '%{count} Sekunden'
|
||||||
|
prompts:
|
||||||
|
day: Tag
|
||||||
|
hour: Stunden
|
||||||
|
minute: Minuten
|
||||||
|
month: Monat
|
||||||
|
second: Sekunden
|
||||||
|
year: Jahr
|
||||||
|
errors:
|
||||||
|
format: '%{attribute} %{message}'
|
||||||
|
messages:
|
||||||
|
accepted: muss akzeptiert werden
|
||||||
|
blank: muss ausgefüllt werden
|
||||||
|
present: darf nicht ausgefüllt werden
|
||||||
|
confirmation: stimmt nicht mit %{attribute} überein
|
||||||
|
empty: muss ausgefüllt werden
|
||||||
|
equal_to: muss genau %{count} sein
|
||||||
|
even: muss gerade sein
|
||||||
|
exclusion: ist nicht verfügbar
|
||||||
|
greater_than: muss größer als %{count} sein
|
||||||
|
greater_than_or_equal_to: muss größer oder gleich %{count} sein
|
||||||
|
inclusion: ist kein gültiger Wert
|
||||||
|
invalid: ist nicht gültig
|
||||||
|
less_than: muss kleiner als %{count} sein
|
||||||
|
less_than_or_equal_to: muss kleiner oder gleich %{count} sein
|
||||||
|
not_a_number: ist keine Zahl
|
||||||
|
not_an_integer: muss ganzzahlig sein
|
||||||
|
odd: muss ungerade sein
|
||||||
|
record_invalid: 'Gültigkeitsprüfung ist fehlgeschlagen: %{errors}'
|
||||||
|
restrict_dependent_destroy:
|
||||||
|
many: Datensatz kann nicht gelöscht werden, da abhängige %{record} existieren.
|
||||||
|
one: Datensatz kann nicht gelöscht werden, da ein abhängiger %{record}-Datensatz
|
||||||
|
existiert.
|
||||||
|
taken: ist bereits vergeben
|
||||||
|
too_long: ist zu lang (mehr als %{count} Zeichen)
|
||||||
|
too_short: ist zu kurz (weniger als %{count} Zeichen)
|
||||||
|
wrong_length: hat die falsche Länge (muss genau %{count} Zeichen haben)
|
||||||
|
other_than: darf nicht gleich %{count} sein
|
||||||
|
template:
|
||||||
|
body: 'Bitte überprüfen Sie die folgenden Felder:'
|
||||||
|
header:
|
||||||
|
one: 'Konnte %{model} nicht speichern: ein Fehler.'
|
||||||
|
other: 'Konnte %{model} nicht speichern: %{count} Fehler.'
|
||||||
|
helpers:
|
||||||
|
select:
|
||||||
|
prompt: Bitte wählen
|
||||||
|
submit:
|
||||||
|
create: '%{model} erstellen'
|
||||||
|
submit: '%{model} speichern'
|
||||||
|
update: '%{model} aktualisieren'
|
||||||
|
number:
|
||||||
|
currency:
|
||||||
|
format:
|
||||||
|
delimiter: .
|
||||||
|
format: '%n %u'
|
||||||
|
precision: 2
|
||||||
|
separator: ','
|
||||||
|
significant: false
|
||||||
|
strip_insignificant_zeros: false
|
||||||
|
unit: €
|
||||||
|
format:
|
||||||
|
delimiter: .
|
||||||
|
precision: 2
|
||||||
|
separator: ','
|
||||||
|
significant: false
|
||||||
|
strip_insignificant_zeros: false
|
||||||
|
human:
|
||||||
|
decimal_units:
|
||||||
|
format: '%n %u'
|
||||||
|
units:
|
||||||
|
billion:
|
||||||
|
one: Milliarde
|
||||||
|
other: Milliarden
|
||||||
|
million: Millionen
|
||||||
|
quadrillion:
|
||||||
|
one: Billiarde
|
||||||
|
other: Billiarden
|
||||||
|
thousand: Tausend
|
||||||
|
trillion: Billionen
|
||||||
|
unit: ''
|
||||||
|
format:
|
||||||
|
delimiter: ''
|
||||||
|
precision: 1
|
||||||
|
significant: true
|
||||||
|
strip_insignificant_zeros: true
|
||||||
|
storage_units:
|
||||||
|
format: '%n %u'
|
||||||
|
units:
|
||||||
|
byte:
|
||||||
|
one: Byte
|
||||||
|
other: Bytes
|
||||||
|
gb: GB
|
||||||
|
kb: KB
|
||||||
|
mb: MB
|
||||||
|
tb: TB
|
||||||
|
percentage:
|
||||||
|
format:
|
||||||
|
delimiter: ''
|
||||||
|
format: "%n%"
|
||||||
|
precision:
|
||||||
|
format:
|
||||||
|
delimiter: ''
|
||||||
|
support:
|
||||||
|
array:
|
||||||
|
last_word_connector: ' und '
|
||||||
|
two_words_connector: ' und '
|
||||||
|
words_connector: ', '
|
||||||
|
time:
|
||||||
|
am: vormittags
|
||||||
|
formats:
|
||||||
|
default: '%A, %d. %B %Y, %H:%M Uhr'
|
||||||
|
long: '%A, %d. %B %Y, %H:%M Uhr'
|
||||||
|
short: '%d. %B, %H:%M Uhr'
|
||||||
|
pm: nachmittags
|
||||||
@ -1,23 +0,0 @@
|
|||||||
# Files in the config/locales directory are used for internationalization
|
|
||||||
# and are automatically loaded by Rails. If you want to use locales other
|
|
||||||
# than English, add the necessary files in this directory.
|
|
||||||
#
|
|
||||||
# To use the locales, use `I18n.t`:
|
|
||||||
#
|
|
||||||
# I18n.t 'hello'
|
|
||||||
#
|
|
||||||
# In views, this is aliased to just `t`:
|
|
||||||
#
|
|
||||||
# <%= t('hello') %>
|
|
||||||
#
|
|
||||||
# To use a different locale, set it with `I18n.locale`:
|
|
||||||
#
|
|
||||||
# I18n.locale = :es
|
|
||||||
#
|
|
||||||
# This would use the information in config/locales/es.yml.
|
|
||||||
#
|
|
||||||
# To learn more, please read the Rails Internationalization guide
|
|
||||||
# available at http://guides.rubyonrails.org/i18n.html.
|
|
||||||
|
|
||||||
en:
|
|
||||||
hello: "Hello world"
|
|
||||||
14
config/locales/models/problem/de.yml
Normal file
14
config/locales/models/problem/de.yml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# ruby encoding: utf-8
|
||||||
|
|
||||||
|
de:
|
||||||
|
activerecord:
|
||||||
|
models:
|
||||||
|
problem:
|
||||||
|
one: Problem
|
||||||
|
other: Probleme
|
||||||
|
attributes:
|
||||||
|
problem:
|
||||||
|
id: ID
|
||||||
|
translation_id: Übersetzungs-ID
|
||||||
|
title: Titel
|
||||||
|
content: Inhalt
|
||||||
14
config/locales/models/translation/de.yml
Normal file
14
config/locales/models/translation/de.yml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# ruby encoding: utf-8
|
||||||
|
|
||||||
|
de:
|
||||||
|
activerecord:
|
||||||
|
models:
|
||||||
|
translation:
|
||||||
|
one: Übersetzung
|
||||||
|
other: Übersetzungen
|
||||||
|
attributes:
|
||||||
|
translation:
|
||||||
|
id: ID
|
||||||
|
problem_id: Problem-ID
|
||||||
|
title: Titel
|
||||||
|
content: Inhalt
|
||||||
11
config/locales/views/problems/de.yml
Normal file
11
config/locales/views/problems/de.yml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# ruby encoding: utf-8
|
||||||
|
|
||||||
|
de:
|
||||||
|
problems:
|
||||||
|
not_yet_translated: Dieses Problem wurde noch nicht übersetzt.
|
||||||
|
index:
|
||||||
|
suggest_translation: Übersetzung vorschlagen
|
||||||
|
show:
|
||||||
|
improve_translation: Übersetzung verbessern
|
||||||
|
problem_subtitle: Problem %{id}
|
||||||
|
view_original_problem: Dieses Problem auf projecteuler.net
|
||||||
9
config/locales/views/translations/de.yml
Normal file
9
config/locales/views/translations/de.yml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# ruby encoding: utf-8
|
||||||
|
|
||||||
|
de:
|
||||||
|
translations:
|
||||||
|
new:
|
||||||
|
back: Zurück
|
||||||
|
new_translation: Neue Übersetzung für Problem %{id}
|
||||||
|
notice:
|
||||||
|
successfully_created: Übersetzung wurde erfolgreich erstellt.
|
||||||
Loading…
Reference in New Issue
Block a user