mirror of
https://github.com/projekteuler/projekteuler.git
synced 2025-12-10 08:46:41 +01:00
Add MathJax to seeds.rb, update locales
This commit is contained in:
parent
93b0cad73d
commit
913d9ec0b7
2
Gemfile
2
Gemfile
@ -14,6 +14,8 @@ gem 'coffee-rails', '~> 4.2.2'
|
|||||||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
||||||
# gem 'therubyracer', platforms: :ruby
|
# gem 'therubyracer', platforms: :ruby
|
||||||
|
|
||||||
|
gem 'rails-i18n', '~> 5.0.0'
|
||||||
|
|
||||||
gem 'rails-controller-testing'
|
gem 'rails-controller-testing'
|
||||||
|
|
||||||
# Use jquery as the JavaScript library
|
# Use jquery as the JavaScript library
|
||||||
|
|||||||
@ -132,6 +132,9 @@ GEM
|
|||||||
nokogiri (>= 1.6)
|
nokogiri (>= 1.6)
|
||||||
rails-html-sanitizer (1.0.3)
|
rails-html-sanitizer (1.0.3)
|
||||||
loofah (~> 2.0)
|
loofah (~> 2.0)
|
||||||
|
rails-i18n (5.0.4)
|
||||||
|
i18n (~> 0.7)
|
||||||
|
railties (~> 5.0)
|
||||||
railties (5.1.4)
|
railties (5.1.4)
|
||||||
actionpack (= 5.1.4)
|
actionpack (= 5.1.4)
|
||||||
activesupport (= 5.1.4)
|
activesupport (= 5.1.4)
|
||||||
@ -214,6 +217,7 @@ DEPENDENCIES
|
|||||||
mathjax-rails (~> 2.6.1)
|
mathjax-rails (~> 2.6.1)
|
||||||
rails (= 5.1.4)
|
rails (= 5.1.4)
|
||||||
rails-controller-testing
|
rails-controller-testing
|
||||||
|
rails-i18n (~> 5.0.0)
|
||||||
sass-rails (~> 5.0.7)
|
sass-rails (~> 5.0.7)
|
||||||
sdoc (~> 0.4.2)
|
sdoc (~> 0.4.2)
|
||||||
sqlite3 (~> 1.3.13)
|
sqlite3 (~> 1.3.13)
|
||||||
|
|||||||
@ -20,7 +20,7 @@ module ApplicationHelper
|
|||||||
|
|
||||||
# Returns the full title on a per-page basis.
|
# Returns the full title on a per-page basis.
|
||||||
def full_title(page_title = '')
|
def full_title(page_title = '')
|
||||||
base_title = t('site_title')
|
base_title = t('application.site_title')
|
||||||
if page_title.empty?
|
if page_title.empty?
|
||||||
base_title
|
base_title
|
||||||
else
|
else
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<%= navbar position: :static do %>
|
<%= navbar position: :static do %>
|
||||||
<%= vertical do %>
|
<%= vertical do %>
|
||||||
<%= link_to t(:site_title), root_path %>
|
<%= link_to t('application.site_title'), root_path %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= horizontal do %>
|
<%= horizontal do %>
|
||||||
<%= nav class: 'navbar-left' do %>
|
<%= nav class: 'navbar-left' do %>
|
||||||
|
|||||||
@ -1,205 +0,0 @@
|
|||||||
---
|
|
||||||
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
|
|
||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
de:
|
de:
|
||||||
application:
|
application:
|
||||||
|
site_title: "Projekt Euler"
|
||||||
sign_in: 'Einloggen'
|
sign_in: 'Einloggen'
|
||||||
sign_out: 'Ausloggen'
|
sign_out: 'Ausloggen'
|
||||||
info: "Info"
|
info: "Info"
|
||||||
|
|||||||
35
db/seeds.rb
35
db/seeds.rb
@ -10,19 +10,34 @@ Translation.delete_all
|
|||||||
Problem.delete_all
|
Problem.delete_all
|
||||||
Admin.delete_all
|
Admin.delete_all
|
||||||
|
|
||||||
for i in 1..10 do
|
|
||||||
translation = Translation.create(
|
for i in 1..20 do
|
||||||
problem_id: i,
|
Problem.create!(id: i)
|
||||||
title: "Problem Nummer #{i}",
|
|
||||||
content: "Das hier ist der Inhalt von <b>Problem #{i}</b>.<br />Hier ist die zweite Zeile."
|
|
||||||
)
|
|
||||||
Problem.create(id: i, translation_id: translation.id)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Problem.create(id: 11)
|
for i in 1..10 do
|
||||||
|
translation = Translation.create!(
|
||||||
|
problem: Problem.find(i),
|
||||||
|
title: "Problem Nummer #{i}",
|
||||||
|
content: %Q(<p>Das hier ist der Inhalt von <b>Problem #{i}</b>.
|
||||||
|
<br />Hier ist die zweite Zeile.</p>
|
||||||
|
<p>Es können auch Formeln im Text (z.B. $1+2=3$) oder als eigene Zeile genutzt werden.</p>
|
||||||
|
\\[ a^2 + b^2 = c^2 \\]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
Admin.create(
|
problem = Problem.find(i)
|
||||||
|
problem.translation = translation
|
||||||
|
problem.save!
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Admin.create!(
|
||||||
email: 'admin@example.com',
|
email: 'admin@example.com',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
password_confirmation: 'password'
|
password_confirmation: 'password'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
p "Created #{Problem.count} problems"
|
||||||
|
p "Created #{Translation.count} translations"
|
||||||
|
p "Created #{Admin.count} admins"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user