Skip to content

Commit d4fcce2

Browse files
committed
chore: improved locales
1 parent fd09224 commit d4fcce2

File tree

5 files changed

+16
-10
lines changed

5 files changed

+16
-10
lines changed

app/models/activity.rb

+12-6
Original file line numberDiff line numberDiff line change
@@ -390,17 +390,21 @@ def activity_url
390390
return "https://koala.svsticky.nl/activities/#{ id }"
391391
end
392392

393+
# The description of the activity in the specified locale
393394
def description_localised(locale)
394395
return locale == :nl ? description_nl : description_en
395396
end
396397

397398
# This generates an URL representing a calendar activity template, filled with data from the koala activity
398-
def google_event(loc = nil)
399+
def google_event(locale = nil)
399400
return nil if start.nil? || self.end.nil?
400401

401-
loc = I18n.locale if loc.nil?
402-
disclaimer = "[#{ I18n.t('activerecord.attributes.activity.disclaimer') }]"
403-
description = "#{ activity_url }\n\n#{ description_localised(loc) }\n\n#{ disclaimer }"
402+
locale = I18n.locale if locale.nil?
403+
404+
disclaimer = "[#{ I18n.t('activerecord.attributes.activity.disclaimer', deep_interpolation: true,
405+
datetime: DateTime.current.utc.to_s) }]"
406+
description = "#{ activity_url }\n\n#{ description_localised(locale) }\n\n#{ disclaimer }"
407+
404408
uri_name = URI.encode_www_form_component(name)
405409
uri_description = URI.encode_www_form_component(description)
406410
uri_location = URI.encode_www_form_component(location)
@@ -442,7 +446,7 @@ def gen_time_string(loc)
442446
return fmt_dt.call(start_date) + fmt_tm.call(start_time) + edt
443447
end
444448

445-
# Converts a sticky activity to an iCalendar event
449+
# Converts a Sticky activity to an iCalendar event
446450
def to_calendar_event(locale)
447451
event = Icalendar::Event.new
448452
event.uid = id.to_s
@@ -458,7 +462,9 @@ def to_calendar_event(locale)
458462
end
459463

460464
event.summary = name
461-
event.description = description_localised(locale)
465+
event.description = "#{ activity_url }\r\n\r\n\
466+
#{ description_localised(locale) }\r\n\r\n\
467+
Last synced on: #{ DateTime.current.utc }"
462468
event.location = location
463469
return event
464470
end

config/locales/en.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ en:
3333
description: Description
3434
description_en: English description
3535
description_nl: Dutch description
36-
disclaimer: Data on this activity may be outdated, as it was added as a one-time copy of the information given at that time. Up-to-date info can be found on Koala.
36+
disclaimer: Data about this activity has been added as a one-time copy from what was known on %{datetime}, and as such could be outdated.
3737
end_date: Enddate
3838
end_time: Endtime
3939
google_event: Copy once to calendar

config/locales/members.en.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ en:
1919
calendar:
2020
confirm_understand_icalendar:
2121
confirm: I understand
22-
text: Koala will maintain the icalendar feed you just copied, at all times. However, koala is only aware of activities for which you are enrolled through koala, and not through some other platform (like Pretix or a Google form). Remember to add those activities to your calendar manually.
22+
text: Koala will maintain the icalendar feed you just copied to your clipboard, at all times. However, koala is only aware of activities for which you are enrolled through koala, and not through some other platform (like Pretix or a Google form). Remember to add those activities to your calendar manually.
2323
title: Warning
2424
error:
2525
edit: Could not edit!

config/locales/members.nl.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ nl:
1919
calendar:
2020
confirm_understand_icalendar:
2121
confirm: Ik begrijp het
22-
text: Koala zal de icalendar feed die je zojuist hebt gekopieerd te allen tijde bijwerken. Echter, is koala alleen op de hoogte van activiteiten waarvoor je je via Koala hebt ingeschreven, en niet via een ander platform (zoals Pretix of een Google Form). Vergeet niet om die activiteiten handmatig aan je agenda toe te voegen.
22+
text: Koala zal de icalendar feed die je zojuist hebt gekopieerd naar je klembord ten aller tijde bijwerken. Echter, is koala alleen op de hoogte van activiteiten waarvoor je je via Koala hebt ingeschreven, en niet via een ander platform (zoals Pretix of een Google Form). Vergeet niet om die activiteiten handmatig aan je agenda toe te voegen.
2323
title: Waarschuwing
2424
error:
2525
edit: Kon niet bijwerken!

config/locales/nl.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ nl:
3333
description: Beschrijving
3434
description_en: Engelse beschrijving
3535
description_nl: Nederlandse beschrijving
36-
disclaimer: Gegevens in deze afspraak kunnen outdated zijn, omdat deze waren toegevoegd als een eenmalig kopie van wat toen bekend was. Up-to-date informatie staat op Koala.
36+
disclaimer: Gegevens over deze activiteit zijn toegevoegd als een eenmalig kopie van wat bekend was op %{datetime}, en kunnen dus verouderd zijn.
3737
end_date: Einddatum
3838
end_time: Eindtijd
3939
google_event: Kopiëer eenmalig naar agenda

0 commit comments

Comments
 (0)