Commit 45ebd8e2 authored by Phu Nguyen's avatar Phu Nguyen
Browse files

Improvements

- Compare original messages and translated messages as objects instead of as values
- It's now possible to declare javascript in the frontmatter of content files
parent 3e24ef2e
......@@ -3,6 +3,8 @@ title: "Paypal Donations"
include_html: /community/donations/previousdonations.php
sassFiles:
- sass/previousdonations.scss
jsFiles:
- https://cdn.kde.org/aether-devel/charjs.js
---
The following contributions have been generously made through PayPal to KDE using the <a href="../">donation</a> form. If you want to contribute in other ways, look at the overview page to see all the ways you can <a href="../">contribute</a>. We thank the donors listed below for their support!
......@@ -15,7 +17,3 @@ Note this list does not include campaign specific donations like:
- <a href="/fundraisers/yearend2016/">KDE End of Year 2016 Fundraising</a>
Note: donations that have been made in the past in US$ are converted to Euro on Aug 8th 2011 with a current exchange rate of 1 US$ = 0.7002 Euro. The original amount is listed.
{{< stop-translate >}}
<script src="https://cdn.kde.org/aether-devel/charjs.js"></script>
......@@ -244,7 +244,7 @@ def import_content(post, _) -> tp.Tuple[str, float]:
is_translated = len(processed_line[0]) > 0
if is_translated:
for string in processed_line[0]:
if _(string) == string or len(_(string)) == 0 or len(string) == 0:
if _(string) is string or len(_(string)) == 0 or len(string) == 0:
is_translated = False
totalString += 1
......@@ -277,7 +277,7 @@ def import_content(post, _) -> tp.Tuple[str, float]:
is_translated = len(processed_line[0]) > 0
if is_translated:
for string in processed_line[0]:
if _(string) == string or len(_(string)) == 0 or len(string) == 0:
if _(string) is string or len(_(string)) == 0 or len(string) == 0:
is_translated = False
totalString += 1
if not is_translated:
......@@ -425,7 +425,6 @@ def generate_translations(args):
if percent > 0.5 or percent == -1 or has_translations:
translated_count += 1
print(translated_page)
with open(translated_page, 'w+') as translation_file:
translation_file.write('---\n')
translation_file.write(dump(post.metadata, default_flow_style=False, allow_unicode=True))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment