|
2 | 2 |
|
3 | 3 | module ChaptersHelper |
4 | 4 | ACTIVITIES = [ |
5 | | - { image: 'activities_local_meetups.png', title: 'Local meetups' }, |
6 | | - { image: 'activities_local_conferences.png', title: 'conferences' }, |
7 | | - { image: 'activities_local_programming.png', title: 'programming' }, |
8 | | - { image: 'activities_local_workshops.png', title: 'workshops' }, |
9 | | - { image: 'activities_local_hackathons.png', title: 'hackathons' } |
| 5 | + { image: 'activities_local_meetups.png', title_key: 'activities.meetups' }, |
| 6 | + { image: 'activities_local_conferences.png', title_key: 'activities.conferences' }, |
| 7 | + { image: 'activities_local_programming.png', title_key: 'activities.programming' }, |
| 8 | + { image: 'activities_local_workshops.png', title_key: 'activities.workshops' }, |
| 9 | + { image: 'activities_local_hackathons.png', title_key: 'activities.hackathons' } |
10 | 10 | ].freeze |
11 | 11 |
|
12 | 12 | CHAPTERS = [ |
13 | | - { country: 'Kenya', image: 'country_kenya.png', alt: 'Nairuby' }, |
14 | | - { country: 'Rwanda', image: 'country_rwanda.png', alt: 'ARC_Rwanda' }, |
15 | | - { country: 'Tanzania', image: 'country_tanzania.png', alt: 'ARC_Tanzania' }, |
16 | | - { country: 'Uganda', image: 'country_uganda.png', alt: 'ARC_Uganda' } |
| 13 | + { country_key: 'chapters.countries.kenya', image: 'country_kenya.png', alt_key: 'chapters.alt_text.nairuby' }, |
| 14 | + { country_key: 'chapters.countries.rwanda', image: 'country_rwanda.png', alt_key: 'chapters.alt_text.arc_rwanda' }, |
| 15 | + { country_key: 'chapters.countries.tanzania', image: 'country_tanzania.png', |
| 16 | + alt_key: 'chapters.alt_text.arc_tanzania' }, |
| 17 | + { country_key: 'chapters.countries.uganda', image: 'country_uganda.png', alt_key: 'chapters.alt_text.arc_uganda' } |
17 | 18 | ].freeze |
18 | 19 |
|
19 | 20 | FEATURED_SPONSORS = [ |
20 | | - { image: 'sponsors/current/solutech_official.svg', link: 'https://solutech.co.ke', alt: 'Solutech' }, |
21 | | - { image: 'sponsors/current/app_signal.png', link: 'https://www.appsignal.com', alt: 'App Signal' }, |
22 | | - { image: 'sponsors/current/ruby_central.png', link: 'https://rubycentral.org/', alt: 'Ruby Central' }, |
23 | | - { image: 'sponsors/current/kopo_kopo.png', link: 'https://kopokopo.co.ke', alt: 'Kopo Kopo' }, |
24 | | - { image: 'sponsors/current/finplus.png', link: 'https://finplusgroup.com', alt: 'Finplus Group' }, |
25 | | - { image: 'sponsors/current/typesense-logo.png', link: 'https://typesense.org/', alt: 'Typesense' }, |
26 | | - { image: 'sponsors/current/daystar.png', link: 'https://www.daystar.ac.ke/', alt: 'Daystar' }, |
27 | | - { image: 'sponsors/current/prosper.png', link: 'https://www.prosperhedge.com/', alt: 'Prosper Hedge' }, |
28 | | - { image: 'sponsors/current/gurzu.png', link: 'https://gurzu.com/', alt: 'Gurzu' }, |
29 | | - { image: 'sponsors/current/must-company.png', link: 'https://must.company/', alt: 'Must Company' } |
| 21 | + { image: 'sponsors/current/solutech_official.svg', link: 'https://solutech.co.ke', |
| 22 | + alt_key: 'sponsors.current.solutech' }, |
| 23 | + { image: 'sponsors/current/app_signal.png', link: 'https://www.appsignal.com', |
| 24 | + alt_key: 'sponsors.current.app_signal' }, |
| 25 | + { image: 'sponsors/current/ruby_central.png', link: 'https://rubycentral.org/', |
| 26 | + alt_key: 'sponsors.current.ruby_central' }, |
| 27 | + { image: 'sponsors/current/kopo_kopo.png', link: 'https://kopokopo.co.ke', alt_key: 'sponsors.current.kopo_kopo' }, |
| 28 | + { image: 'sponsors/current/finplus.png', link: 'https://finplusgroup.com', alt_key: 'sponsors.current.finplus' }, |
| 29 | + { image: 'sponsors/current/typesense-logo.png', link: 'https://typesense.org/', |
| 30 | + alt_key: 'sponsors.current.typesense' }, |
| 31 | + { image: 'sponsors/current/daystar.png', link: 'https://www.daystar.ac.ke/', alt_key: 'sponsors.current.daystar' }, |
| 32 | + { image: 'sponsors/current/prosper.png', link: 'https://www.prosperhedge.com/', |
| 33 | + alt_key: 'sponsors.current.prosper' }, |
| 34 | + { image: 'sponsors/current/gurzu.png', link: 'https://gurzu.com/', alt_key: 'sponsors.current.gurzu' }, |
| 35 | + { image: 'sponsors/current/must-company.png', link: 'https://must.company/', alt_key: 'sponsors.current.must_company' } |
30 | 36 | ].freeze |
31 | 37 |
|
32 | 38 | PREVIOUS_SPONSORS = [ |
33 | | - { image: 'sponsors/previous/shopify.webp', link: 'https://www.shopify.com/', alt: 'Shopify' }, |
34 | | - { image: 'sponsors/previous/microverse.png', link: 'https://www.microverse.org/', alt: 'Microverse' }, |
35 | | - { image: 'sponsors/previous/planet_argon.png', link: 'https://www.planetargon.com', alt: 'Planet Argon' }, |
36 | | - { image: 'sponsors/previous/nairobits.png', link: 'https://www.nairobits.com/', alt: 'Nairobits' }, |
37 | | - { image: 'sponsors/previous/turing.png', link: 'https://www.turing.com/', alt: 'Turing' }, |
38 | | - { image: 'sponsors/previous/kwara.png', link: 'https://kwara.com/', alt: 'Kwara' }, |
39 | | - { image: 'sponsors/previous/ihub.png', link: 'https://ihub.co.ke/', alt: 'iHub, Nairobi' }, |
40 | | - { image: 'sponsors/previous/friendly_rb.jpg', link: 'https://friendlyrb.com/', alt: 'FriendlyRB' }, |
41 | | - { image: 'sponsors/previous/kca.png', link: 'https://www.kcau.ac.ke', alt: 'KCA University' }, |
42 | | - { image: 'sponsors/previous/andela.png', link: 'https://andela.com/', alt: 'Andela' } |
| 39 | + { image: 'sponsors/previous/shopify.webp', link: 'https://www.shopify.com/', alt_key: 'sponsors.previous.shopify' }, |
| 40 | + { image: 'sponsors/previous/microverse.png', link: 'https://www.microverse.org/', |
| 41 | + alt_key: 'sponsors.previous.microverse' }, |
| 42 | + { image: 'sponsors/previous/planet_argon.png', link: 'https://www.planetargon.com', |
| 43 | + alt_key: 'sponsors.previous.planet_argon' }, |
| 44 | + { image: 'sponsors/previous/nairobits.png', link: 'https://www.nairobits.com/', |
| 45 | + alt_key: 'sponsors.previous.nairobits' }, |
| 46 | + { image: 'sponsors/previous/turing.png', link: 'https://www.turing.com/', alt_key: 'sponsors.previous.turing' }, |
| 47 | + { image: 'sponsors/previous/kwara.png', link: 'https://kwara.com/', alt_key: 'sponsors.previous.kwara' }, |
| 48 | + { image: 'sponsors/previous/ihub.png', link: 'https://ihub.co.ke/', alt_key: 'sponsors.previous.ihub' }, |
| 49 | + { image: 'sponsors/previous/friendly_rb.jpg', link: 'https://friendlyrb.com/', |
| 50 | + alt_key: 'sponsors.previous.friendly_rb' }, |
| 51 | + { image: 'sponsors/previous/kca.png', link: 'https://www.kcau.ac.ke', alt_key: 'sponsors.previous.kca' }, |
| 52 | + { image: 'sponsors/previous/andela.png', link: 'https://andela.com/', alt_key: 'sponsors.previous.andela' } |
43 | 53 | ].freeze |
44 | 54 |
|
45 | 55 | SOCIALS = [ |
46 | | - { alt: 'ARC Twitter', link: 'https://twitter.com/ruby_african', image: 'brands_twitter.png', show: true }, |
47 | | - { alt: 'ARC telegram', link: '#', image: 'brands_telegram.png', |
| 56 | + { alt_key: 'social_media.twitter', link: 'https://twitter.com/ruby_african', image: 'brands_twitter.png', |
| 57 | + show: true }, |
| 58 | + { alt_key: 'social_media.telegram', link: '#', image: 'brands_telegram.png', |
48 | 59 | show: FeatureFlag.find_by(name: 'telegram')&.enabled }, |
49 | | - { alt: 'ARC facebook', link: 'https://www.facebook.com/rubycommunity.africa', image: 'brands_facebook.png', |
| 60 | + { alt_key: 'social_media.facebook', link: 'https://www.facebook.com/rubycommunity.africa', |
| 61 | + image: 'brands_facebook.png', |
50 | 62 | show: true }, |
51 | | - { alt: 'ARC Instagram', link: '#', image: 'brands_instagram.png', show: true }, |
52 | | - { alt: 'ARC LinkedIn', link: 'https://www.linkedin.com/company/african-ruby-community/', |
| 63 | + { alt_key: 'social_media.instagram', link: '#', image: 'brands_instagram.png', show: true }, |
| 64 | + { alt_key: 'social_media.linkedin', link: 'https://www.linkedin.com/company/african-ruby-community/', |
53 | 65 | image: 'brands_linkedin.png', show: true }, |
54 | | - { alt: 'ARC Github', link: 'https://github.com/nairuby', image: 'brands_github.png', show: true } |
| 66 | + { alt_key: 'social_media.github', link: 'https://github.com/nairuby', image: 'brands_github.png', show: true } |
55 | 67 | ].freeze |
56 | 68 |
|
57 | 69 | def activities |
58 | | - ACTIVITIES |
| 70 | + ACTIVITIES.map do |activity| |
| 71 | + activity.merge(title: I18n.t(activity[:title_key])) |
| 72 | + end |
59 | 73 | end |
60 | 74 |
|
61 | 75 | def chapters |
62 | 76 | CHAPTERS |
63 | 77 | end |
64 | 78 |
|
65 | 79 | def featured_sponsors |
66 | | - FEATURED_SPONSORS |
| 80 | + FEATURED_SPONSORS.map do |sponsor| |
| 81 | + sponsor.merge(alt: I18n.t(sponsor[:alt_key])) |
| 82 | + end |
67 | 83 | end |
68 | 84 |
|
69 | 85 | def previous_sponsors |
70 | | - PREVIOUS_SPONSORS |
| 86 | + PREVIOUS_SPONSORS.map do |sponsor| |
| 87 | + sponsor.merge(alt: I18n.t(sponsor[:alt_key])) |
| 88 | + end |
71 | 89 | end |
72 | 90 |
|
73 | 91 | def socials |
74 | | - SOCIALS |
| 92 | + SOCIALS.map do |social| |
| 93 | + social.merge(alt: I18n.t(social[:alt_key])) |
| 94 | + end |
75 | 95 | end |
76 | 96 | end |
0 commit comments