Skip to content

Commit

Permalink
I18n translations for DE (#93)
Browse files Browse the repository at this point in the history
* locals

* about translations

* locale link

* translations

* add translations

* german translations

* german translations

* locales

* urls

* fix tests
  • Loading branch information
salza80 authored Apr 20, 2024
1 parent 71b1c93 commit 2e694a8
Show file tree
Hide file tree
Showing 52 changed files with 1,327 additions and 584 deletions.
11 changes: 11 additions & 0 deletions deployment/scripts/urls-prod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,14 @@ schengen-calculator.com/robots.txt
schengen-calculator.com/ads.txt
schengen-calculator.com/med.png
schengen-calculator.com/blog/extended-schengen-stay
schengen-calculator.com/en
schengen-calculator.com/en/about
schengen-calculator.com/en/about/British
schengen-calculator.com/en/about/American
schengen-calculator.com/en/blog/extended-schengen-stay
schengen-calculator.com/de
schengen-calculator.com/de/about
schengen-calculator.com/de/about/British
schengen-calculator.com/de/about/American
schengen-calculator.com/de/blog/extended-schengen-stay

10 changes: 10 additions & 0 deletions deployment/scripts/urls-staging.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,13 @@ test.schengen-calculator.com/robots.txt
test.schengen-calculator.com/ads.txt
test.schengen-calculator.com/med.png
test.schengen-calculator.com/blog/extended-schengen-stay
test.schengen-calculator.com/en
test.schengen-calculator.com/en/about
test.schengen-calculator.com/en/about/British
test.schengen-calculator.com/en/about/American
test.schengen-calculator.com/en/blog/extended-schengen-stay
test.schengen-calculator.com/de
test.schengen-calculator.com/de/about
test.schengen-calculator.com/de/about/British
test.schengen-calculator.com/de/about/American
test.schengen-calculator.com/de/blog/extended-schengen-stay
17 changes: 17 additions & 0 deletions src/app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,25 @@ class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
# skip_before_action :verify_authenticity_token

helper_method :current_user_or_guest_user, :amazon
# around_action :switch_locale

before_action :set_locale_from_params

def default_url_options
{ locale: I18n.locale }
end
private

def set_locale_from_params
I18n.locale = params[:locale] || I18n.default_locale
end
# def switch_locale(&action)
# locale = params[:locale] || I18n.default_locale
# I18n.with_locale(locale, &action)
# end

def amazon
visits = current_user_or_guest_user.visits.find_by_date(Date.today + 1.month, Date.new(3000, 1, 1))
Expand Down
13 changes: 13 additions & 0 deletions src/app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,17 @@ def title(page_title)
def active_if(options)
'active' if params.merge(options) == params
end

def language_selector
locales = Rails.application.config.i18n.available_locales
current_locale = I18n.locale.to_sym

content_tag(:span) do
locales.map do |locale|
content_tag(:span, class: locale == current_locale ? 'active' : '') do
link_to(locale.upcase, locale: locale)
end
end.join(" | ").html_safe
end
end
end
70 changes: 18 additions & 52 deletions src/app/views/about/_nationality.html.haml
Original file line number Diff line number Diff line change
@@ -1,57 +1,23 @@
%h3
Schengen / Europe tourist travel entry and length of stay requirements for
= @country.nationality_plural
%h4
Do
= @country.nationality_plural
need to apply for a Schengen Touist Visa before entry?
%p
%h3= t('about.nationality.tourist_travel_requirements_title', nationality_plural: @country.nationality_plural)
%h4= t('about.nationality.schengen_visa_requirement_title', nationality_plural: @country.nationality_plural)
%p.mb-4
- if @country.visa_required == "F"
No. People from
=@country.name
have freedom of movement withing the EU.
= t('about.nationality.visa_not_required', country: @country.name)
- elsif @country.visa_required == "V"
Yes. People from
= @country.name
must apply for a short-stay schengen visa before entering the Schengen Area.
= t('about.nationality.visa_required', country: @country.name)
- else
No. People from
= @country.name
are exempt from having to obtain a Schengen Visa prior to entry.
= t('about.nationality.visa_exempt', country: @country.name)

%h4
Which Calculation do
= @country.nationality_plural
need to use when calculating length of stay allowed?
%p
- if @country.old_schengen_calc
People from @country.name must use the OLD schengen calculation when working out how long they can stay in the schengen zone.
This is defined as:
%blockquote
"3 months during a 6 months period following the date of first entry"
%footer
%cite{:title => "European Commision"}
=link_to "European Commision", "http://ec.europa.eu/dgs/home-affairs/what-we-do/policies/borders-and-visas/border-crossing/index_en.htm"
-else
People from
=@country.name
must use the NEW schengen calculation when working out how long they can stay in the schengen zone.
This is defined as:
%blockquote
“90 days in any 180-day period […]“. “The date of entry shall be considered as the first day of stay on the territory of the Member States and the date of exit shall be considered as the last day of stay on the territory of the Member States. Periods of stay authorised under a residence permit or a long-stay visa shall not be taken into account in the calculation of the duration of stay on the territory of the Member States.”
%footer
%cite{:title => "European Commision"}
=link_to "European Commision", "http://ec.europa.eu/dgs/home-affairs/what-we-do/policies/borders-and-visas/border-crossing/index_en.htm"
%h4
Does
= @country.name
have any Additional Visa Waiver agreements?
%p
- if @country.additional_visa_waiver
= @country.name
does have additional visa waiver agreements with some schengen countries. These agreements may allow you to stay the schengen area for longer than 90 days. You should exercise caution if you plan to do this, and seek advice before you travel. Note the Schengen Calculator does not take additional visa waiver agreements into account in its calculations.
- else
No.
= @country.name
does not have any additional visa waiver agreements with countries in the schengen area.
%h4= t('about.nationality.length_of_stay_calculation_title', nationality_plural: @country.nationality_plural)
%p.mb-4
- if @country.old_schengen_calc
= raw(t('about.nationality.old_calculation_description', country: @country.name, european_commision_link: link_to(t('about.nationality.european_commision'), 'http://ec.europa.eu/dgs/home-affairs/what-we-do/policies/borders-and-visas/border-crossing/index_en.htm')))
- else
= raw(t('about.nationality.new_calculation_description', country: @country.name, european_commision_link: link_to(t('about.nationality.european_commision'), 'http://ec.europa.eu/dgs/home-affairs/what-we-do/policies/borders-and-visas/border-crossing/index_en.htm')))

%h4= t('about.nationality.additional_visa_waiver_title', country: @country.name)
%p.mb-4
- if @country.additional_visa_waiver
= t('about.nationality.additional_visa_waiver_description', country: @country.name)
- else
= t('about.nationality.no_additional_visa_waiver_description', country: @country.name)
Loading

0 comments on commit 2e694a8

Please sign in to comment.