11#!/usr/bin/env python3
22# vim: set fileencoding=utf-8:
33
4- """Add/Update the language list at the bottom of all CC0 legalcode files.
4+ """Normalize file and add/update the language list at the bottom of all CC0
5+ legalcode files.
56"""
67
78# Copyright 2016, 2017 Creative Commons
@@ -181,7 +182,7 @@ def insert_missing_lang_footer_comments(args, filename, content):
181182
182183
183184def has_correct_faq_officialtranslations (content ):
184- """Determine if the link to the tranlsation FAQ is correct.
185+ """Determine if the link to the translation FAQ is correct.
185186 """
186187 if content .find (f'"{ FAQ_TRANSLATION_LINK } "' ) == - 1 :
187188 return False
@@ -232,16 +233,15 @@ def normalize_faq_translation_link(args, filename, content):
232233
233234
234235def has_correct_languages_anchor (content ):
235- """Determine if the link to the tranlsation FAQ is correct.
236+ """Determine if language anchor uses id
236237 """
237238 if content .find ('id="languages"' ) == - 1 :
238239 return False
239240 return True
240241
241242
242243def normalize_languages_anchor (args , filename , content ):
243- """Replace various incorrect translation FAQ links with the correct link
244- (FAQ_TRANSLATION_LINK).
244+ """Replace name with id in languages anchor (HTML5 compatibility)
245245 """
246246 if has_correct_languages_anchor (content ):
247247 print (
@@ -268,7 +268,7 @@ def normalize_languages_anchor(args, filename, content):
268268
269269
270270def normalize_line_endings (args , filename , content ):
271- """Normalize line endings to unix (\\ n)
271+ """Normalize line endings to unix LF (\\ n)
272272 """
273273 re_pattern = re .compile ("\r (?!\n )" )
274274 matches = re_pattern .findall (content )
0 commit comments