- If you are currently using Dropbox, Google Drive, Microsoft OneDrive or Apple iCloud, you should pick an alternative here.
+ {% t If you are currently using Dropbox, Google Drive, Microsoft OneDrive or Apple iCloud, you should pick an alternative here.%}
{% include cardv2.html
@@ -23,9 +23,9 @@ googleplay="https://play.google.com/store/apps/details?id=com.nextcloud.client"
%}
-
Worth Mentioning
+
{% t Worth Mentioning%}
-
Cryptomator - Free client-side AES encryption for your cloud files. Open source software: No backdoors, no registration.
-
CryptPad - Free and end-to-end encrypted real time collaboration sharing folders, media, and documents.
+
{% t Cryptomator%} - {% t Free client-side AES encryption for your cloud files. Open source software: No backdoors, no registration.%}
+
{% t CryptPad%} - {% t Free and end-to-end encrypted real time collaboration sharing folders, media, and documents.%}
+ {% capture providers_title %}{% t Providers %}{% endcapture %}
+ {% capture providers_page %}/{% if page.language %}{{ page.language }}/{% endif %}providers/{% endcapture %}
+ {% capture providers_description %}{% t Discover privacy-centric online services, including email providers, VPN operators, DNS administrators, and more!%}{% endcapture %}
+
{% include card.html color="success"
- title="Providers"
+ title=providers_title
icon="fas fa-server"
iconcolor="dark"
- page="/providers/"
- description="Discover privacy-centric online services, including email providers, VPN operators, DNS administrators, and more!"
+ page=providers_page
+ description=providers_description
%}
+ {% capture browsers_title %}{% t Web Browsers %}{% endcapture %}
+ {% capture browsers_page %}/{% if page.language %}{{ page.language }}/{% endif %}browsers/{% endcapture %}
+ {% capture browsers_description %}{% t Find a web browser that respects your privacy, and discover how to harden your browser against tracking and leaks.%}{% endcapture %}
+
{% include card.html color="primary"
- title="Web Browsers"
+ title=browsers_title
icon="far fa-compass"
iconcolor="dark"
- page="/browsers/"
- description="Find a web browser that respects your privacy, and discover how to harden your browser against tracking and leaks."
+ page=browsers_page
+ description=browsers_description
%}
+ {% capture software_title %}{% t Software %}{% endcapture %}
+ {% capture software_page %}/{% if page.language %}{{ page.language }}/{% endif %}software/{% endcapture %}
+ {% capture software_description %}{% t Discover a variety of open source software built to protect your privacy and keep your digital data secure.%}{% endcapture %}
+
{% include card.html color="warning"
- title="Software"
+ title=software_title
icon="far fa-window-restore"
iconcolor="dark"
- page="/software/"
- description="Discover a variety of open source software built to protect your privacy and keep your digital data secure."
+ page=software_page
+ description=software_description
%}
+ {% capture os_title %}{% t Operating Systems%}{% endcapture %}
+ {% capture os_page %}/{% if page.language %}{{ page.language }}/{% endif %}operating-systems/{% endcapture %}
+ {% capture os_description %}{% t Find out how your operating system is compromising your privacy, and what simple alternatives exist.%}{% endcapture %}
+
{% include card.html color="info"
- title="Operating Systems"
+ title=os_title
icon="fas fa-desktop"
iconcolor="dark"
- page="/operating-systems/"
- description="Find out how your operating system is compromising your privacy, and what simple alternatives exist."
+ page=os_page
+ description=os_description
%}
+ {% capture services_title %}{% t PrivacyTools Services%}{% endcapture %}
+ {% capture services_page %}/{% if page.language %}{{ page.language }}/{% endif %}services/{% endcapture %}
+ {% capture services_description %}{% t The PrivacyTools team is proud to launch a variety of privacy-centric online services, including a Mastodon instance, search engine, and more!%}{% endcapture %}
+
{% include card.html color="secondary"
- title="PrivacyTools Services"
+ title=services_title
icon="far fa-eye-slash"
iconcolor="dark"
- page="/services/"
- description="The PrivacyTools team is proud to launch a variety of privacy-centric online services, including a Mastodon instance, search engine, and more!"
+ page=services_page
+ description=services_description
%}
+ {% capture donate_title %}{% t Donate%}{% endcapture %}
+ {% capture donate_page %}/{% if page.language %}{{ page.language }}/{% endif %}donate/{% endcapture %}
+ {% capture donate_description %}{% t We can't operate this site without the generous contributions we receive from our viewers. If you love privacy and our website please consider donating.%}{% endcapture %}
+
{% include card.html color="danger"
- title="Donate"
+ title=donate_title
icon="fas fa-donate"
iconcolor="dark"
- page="/donate/"
- description="We can't operate this site without the generous contributions we receive from our viewers. If you love privacy and our website please consider donating."
+ page=donate_page
+ description=donate_description
%}
diff --git a/_plugins/hreflang-tag.rb b/_plugins/hreflang-tag.rb
new file mode 100644
index 00000000..4aeae1fd
--- /dev/null
+++ b/_plugins/hreflang-tag.rb
@@ -0,0 +1,44 @@
+# Copyright 2019 Signal
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+# associated documentation files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge, publish, distribute,
+# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all copies or
+# substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+# NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+module Jekyll
+
+ class HreflangTag < Liquid::Tag
+ def initialize(tag_name, text, tokens)
+ super
+ end
+
+ def render(context)
+ page = context.environments.first["page"]
+ site = context.registers[:site]
+
+ if page["translate"]
+ dir = page["src_dir"].nil? ? page["dir"] : page["src_dir"]
+ hreflangs = %{}
+
+ site.data["languages"].each_key do |language|
+ hreflangs << %{}
+ end
+ end
+
+ hreflangs
+ end
+ end
+
+end
+
+Liquid::Template.register_tag('hreflang', Jekyll::HreflangTag)
diff --git a/_plugins/translate-tag.rb b/_plugins/translate-tag.rb
new file mode 100644
index 00000000..3464e46e
--- /dev/null
+++ b/_plugins/translate-tag.rb
@@ -0,0 +1,47 @@
+# Copyright 2019 Signal
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+# associated documentation files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge, publish, distribute,
+# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all copies or
+# substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+# NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+module Jekyll
+
+ class TranslateTag < Liquid::Tag
+ attr_reader :text, :weblate_id
+
+ def initialize(tag_name, text, tokens)
+ super
+ @text = text.strip
+ @weblate_id = Weblate::ID.get(text)
+ end
+
+ def render(context)
+ page_language = context.environments.first["page"]["language"]
+ site = context.registers[:site]
+
+ if page_language.nil?
+ Weblate::SourceFile.add_entry(weblate_id, text)
+
+ text
+ else
+ translated_string = site.data["languages"][page_language][weblate_id]
+
+ translated_string.nil? ? text : translated_string.strip
+ end
+ end
+ end
+
+end
+
+Liquid::Template.register_tag('t', Jekyll::TranslateTag)
diff --git a/_plugins/translated-page-generator.rb b/_plugins/translated-page-generator.rb
new file mode 100644
index 00000000..c31d6040
--- /dev/null
+++ b/_plugins/translated-page-generator.rb
@@ -0,0 +1,62 @@
+# Copyright 2019 Signal
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+# associated documentation files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge, publish, distribute,
+# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all copies or
+# substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+# NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+module Jekyll
+
+ class TranslatedPage < Page
+ def initialize(site, base, dir, name)
+ @site, @base, @dir, @name = site, base, dir, name
+
+ self.process(@name)
+ self.data ||= {}
+ end
+ end
+
+ class TranslatedPageGenerator < Generator
+ def generate(site)
+ pages_to_translate = site.pages.select { |page| page.data["translate"] }
+
+ pages_to_translate.each do |page|
+ page_title = page.data['title']
+ page_title_weblate_id = Weblate::ID.get(page_title)
+ page_description = page.data['description']
+ page_description_weblate_id = Weblate::ID.get(page_description)
+
+ Weblate::SourceFile.add_entry(page_title_weblate_id, page_title)
+ Weblate::SourceFile.add_entry(page_description_weblate_id, page_description)
+
+ site.data["languages"].each_key do |language|
+ translated_page = Jekyll::TranslatedPage.new(site, site.source, page.dir, page.name)
+ translated_page_title = site.data["languages"][language][page_title_weblate_id]
+ translated_page_description = site.data["languages"][language][page_description_weblate_id]
+
+ translated_page.data = page.data.clone
+ translated_page.data['title'] = translated_page_title.nil? ? page_title : translated_page_title.strip
+ translated_page.data['description'] = translated_page_description.nil? ? page_description
+ : translated_page_description.strip
+ translated_page.data['permalink'] = "#{language}/#{page.dir}"
+ translated_page.data['src_dir'] = page.dir
+ translated_page.data['language'] = language
+ translated_page.content = page.content
+
+ site.pages << translated_page
+ end
+ end
+ end
+ end
+
+end
diff --git a/_plugins/weblate-source-file.rb b/_plugins/weblate-source-file.rb
new file mode 100644
index 00000000..df4b5377
--- /dev/null
+++ b/_plugins/weblate-source-file.rb
@@ -0,0 +1,59 @@
+# Copyright 2019 Signal
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+# associated documentation files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge, publish, distribute,
+# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all copies or
+# substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+# NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+module Weblate
+
+ class ID
+ def self.get(source_text)
+ source_text.nil? ? source_text
+ : source_text.strip[0..100].gsub(/[^\w\d\s\.\?\!]/, '').tr(' ', '_')
+ end
+ end
+
+ class SourceFile
+ class << self
+ def add_entry(weblate_id, source_text)
+ unless id_already_exists?(weblate_id) or source_text.nil?
+ new_entry = <<-YAML
+#{weblate_id}: |
+ #{source_text}
+
+ YAML
+
+ File.write(weblate_source_location, new_entry, mode: 'a')
+ end
+ end
+
+ def id_already_exists?(weblate_id)
+ File.readlines(weblate_source_location).grep(/^#{weblate_id}: \|$/).any?
+ end
+
+ def refresh
+ File.write(weblate_source_location, "---\n")
+ end
+
+ def weblate_source_location
+ "#{__dir__}/../weblate-source-file.yml"
+ end
+ end
+ end
+
+end
+
+Jekyll::Hooks.register :site, :after_init do
+ Weblate::SourceFile.refresh
+end
diff --git a/index.html b/index.html
index cdb2ba37..7796cfcd 100644
--- a/index.html
+++ b/index.html
@@ -1,14 +1,15 @@
---
layout: default
+translate: true
---
{% include sections/header.html %}
{% include sections/resources.html %}
-
Sponsors
+
{% t Sponsors%}
- New! Showcase your brand as a sponsor of PrivacyTools here and support our mission of creating a world free of mass surveillance! Learn more...
+ {% t New!%} {% t Showcase your brand as a sponsor of PrivacyTools here and support our mission of creating a world free of mass surveillance!%} {% t Learn more...%}
{% include sections/quotes.html %}
{% include sections/privacy-resources.html %}
diff --git a/pages/providers.html b/pages/providers.html
index e78f9a4a..ad29b36b 100644
--- a/pages/providers.html
+++ b/pages/providers.html
@@ -1,25 +1,26 @@
---
layout: page
permalink: /providers/
-title: "Providers"
+title: Providers
description: "There's a ton of people providing services online. Discover which ones you should avoid and our recommendations for a variety of services."
+translate: true
---
-
Services
+
{% t Services%}
-
Click on whatever service you need to view our recommendations.
+
{% t Click on whatever service you need to view our recommendations.%}
diff --git a/pages/providers/storage.html b/pages/providers/storage.html
index a71ec8dc..ce9cfd45 100644
--- a/pages/providers/storage.html
+++ b/pages/providers/storage.html
@@ -3,6 +3,7 @@ layout: page
permalink: /providers/cloud-storage/
title: "Cloud Storage"
description: "Find a cloud storage provider that won't look through your files."
+translate: true
---
{% include sections/cloud-storage.html %}
diff --git a/weblate-source-file.yml b/weblate-source-file.yml
new file mode 100644
index 00000000..990b500c
--- /dev/null
+++ b/weblate-source-file.yml
@@ -0,0 +1,121 @@
+---
+Providers: |
+ Providers
+
+Theres_a_ton_of_people_providing_services_online._Discover_which_ones_you_should_avoid_and_our_recom: |
+ There's a ton of people providing services online. Discover which ones you should avoid and our recommendations for a variety of services.
+
+Cloud_Storage: |
+ Cloud Storage
+
+Find_a_cloud_storage_provider_that_wont_look_through_your_files.: |
+ Find a cloud storage provider that won't look through your files.
+
+Privacy_Tools: |
+ Privacy Tools
+
+Prefer_the_classic_site?_View_a_singlepage_layout.: |
+ Prefer the classic site? View a single-page layout.
+
+Discover_privacycentric_online_services_including_email_providers_VPN_operators_DNS_administrator: |
+ Discover privacy-centric online services, including email providers, VPN operators, DNS administrators, and more!
+
+Learn_More: |
+ Learn More
+
+Web_Browsers: |
+ Web Browsers
+
+Find_a_web_browser_that_respects_your_privacy_and_discover_how_to_harden_your_browser_against_tracki: |
+ Find a web browser that respects your privacy, and discover how to harden your browser against tracking and leaks.
+
+Software: |
+ Software
+
+Discover_a_variety_of_open_source_software_built_to_protect_your_privacy_and_keep_your_digital_data_s: |
+ Discover a variety of open source software built to protect your privacy and keep your digital data secure.
+
+Operating_Systems: |
+ Operating Systems
+
+Find_out_how_your_operating_system_is_compromising_your_privacy_and_what_simple_alternatives_exist.: |
+ Find out how your operating system is compromising your privacy, and what simple alternatives exist.
+
+PrivacyTools_Services: |
+ PrivacyTools Services
+
+The_PrivacyTools_team_is_proud_to_launch_a_variety_of_privacycentric_online_services_including_a_Ma: |
+ The PrivacyTools team is proud to launch a variety of privacy-centric online services, including a Mastodon instance, search engine, and more!
+
+Donate: |
+ Donate
+
+We_cant_operate_this_site_without_the_generous_contributions_we_receive_from_our_viewers._If_you_lov: |
+ We can't operate this site without the generous contributions we receive from our viewers. If you love privacy and our website please consider donating.
+
+Sponsors: |
+ Sponsors
+
+New!: |
+ New!
+
+Showcase_your_brand_as_a_sponsor_of_PrivacyTools_here_and_support_our_mission_of_creating_a_world_fre: |
+ Showcase your brand as a sponsor of PrivacyTools here and support our mission of creating a world free of mass surveillance!
+
+Learn_more...: |
+ Learn more...
+
+Encrypted_Cloud_Storage_Services: |
+ Encrypted Cloud Storage Services
+
+If_you_are_currently_using_Dropbox_Google_Drive_Microsoft_OneDrive_or_Apple_iCloud_you_should_pick: |
+ If you are currently using Dropbox, Google Drive, Microsoft OneDrive or Apple iCloud, you should pick an alternative here.
+
+Worth_Mentioning: |
+ Worth Mentioning
+
+Cryptomator: |
+ Cryptomator
+
+Free_clientside_AES_encryption_for_your_cloud_files._Open_source_software_No_backdoors_no_registra: |
+ Free client-side AES encryption for your cloud files. Open source software: No backdoors, no registration.
+
+Cryptomators_mobile_apps_are_not_opensource.: |
+ Cryptomator's mobile apps are not open-source.
+
+CryptPad: |
+ CryptPad
+
+Free_and_endtoend_encrypted_real_time_collaboration_sharing_folders_media_and_documents.: |
+ Free and end-to-end encrypted real time collaboration sharing folders, media, and documents.
+
+Services: |
+ Services
+
+Click_on_whatever_service_you_need_to_view_our_recommendations.: |
+ Click on whatever service you need to view our recommendations.
+
+DNS: |
+ DNS
+
+Email: |
+ Email
+
+Hosting: |
+ Hosting
+
+Pastebins: |
+ Pastebins
+
+Search_Engines: |
+ Search Engines
+
+Social_Networks: |
+ Social Networks
+
+Social_News_Aggregators: |
+ Social News Aggregators
+
+VPN: |
+ VPN
+