Index: gc_lang/fr/build.py
==================================================================
--- gc_lang/fr/build.py
+++ gc_lang/fr/build.py
@@ -8,11 +8,10 @@
import helpers
def build (sLang, dVars, spLangPack):
"complementary build launched from make.py"
- #createFirefoxExtension(sLang, dVars)
createWebExtension(sLang, dVars)
createThunderbirdExtension(sLang, dVars, spLangPack)
def createWebExtension (sLang, dVars):
@@ -36,45 +35,10 @@
for sOpt in lLineOpt:
sHTML += f'
\n'
sHTML += '\n'
return sHTML
-
-def createFirefoxExtension (sLang, dVars):
- "create extension for Firefox (obsolete)"
- print("Building extension for Firefox")
- helpers.createCleanFolder("_build/xpi/"+sLang)
- dir_util.copy_tree("gc_lang/"+sLang+"/xpi/", "_build/xpi/"+sLang)
- dir_util.copy_tree("grammalecte-js", "_build/xpi/"+sLang+"/grammalecte")
- sHTML, dProperties = _createOptionsForFirefox(dVars)
- dVars['optionsHTML'] = sHTML
- helpers.copyAndFileTemplate("_build/xpi/"+sLang+"/data/about_panel.html", "_build/xpi/"+sLang+"/data/about_panel.html", dVars)
- for sLocale in dProperties.keys():
- spfLocale = "_build/xpi/"+sLang+"/locale/"+sLocale+".properties"
- if os.path.exists(spfLocale):
- helpers.copyAndFileTemplate(spfLocale, spfLocale, dProperties)
- else:
- print("Locale file not found: " + spfLocale)
- with helpers.cd("_build/xpi/"+sLang):
- os.system("jpm xpi")
-
-
-def _createOptionsForFirefox (dVars):
- # obsolete
- sHTML = ""
- for sSection, lOpt in dVars['lStructOpt']:
- sHTML += '\n\n
\n'
- for lLineOpt in lOpt:
- for sOpt in lLineOpt:
- sHTML += '
\n'
- sHTML += '
\n'
- # Creating translation data
- dProperties = {}
- for sLang in dVars['dOptLabel'].keys():
- dProperties[sLang] = "\n".join( [ "option_" + sOpt + " = " + dVars['dOptLabel'][sLang][sOpt][0].replace(" [!]", " [!]") for sOpt in dVars['dOptLabel'][sLang] ] )
- return sHTML, dProperties
-
def createThunderbirdExtension (sLang, dVars, spLangPack):
"create extension for Thunderbird"
print("Building extension for Thunderbird")
sExtensionName = dVars['tb_identifier'] + "-v" + dVars['version'] + '.xpi'
@@ -83,15 +47,10 @@
_copyGrammalecteJSPackageInZipFile(hZip, spLangPack)
for spf in ["LICENSE.txt", "LICENSE.fr.txt"]:
hZip.write(spf)
dVars = _createOptionsForThunderbird(dVars)
helpers.addFolderToZipAndFileFile(hZip, "gc_lang/"+sLang+"/tb", "", dVars, True)
- spDict = "gc_lang/"+sLang+"/xpi/data/dictionaries"
- for sp in os.listdir(spDict):
- if os.path.isdir(spDict+"/"+sp):
- hZip.write(spDict+"/"+sp+"/"+sp+".dic", "content/dictionaries/"+sp+"/"+sp+".dic")
- hZip.write(spDict+"/"+sp+"/"+sp+".aff", "content/dictionaries/"+sp+"/"+sp+".aff")
hZip.close()
spDebugProfile = dVars['win_tb_debug_extension_path'] if platform.system() == "Windows" else dVars['linux_tb_debug_extension_path']
helpers.unzip(spfZip, spDebugProfile)
spfBetaExtension = dVars['win_tb_beta_extension_filepath'] if platform.system() == "Windows" else dVars['linux_tb_beta_extension_filepath']
#helpers.unzip(spfZip, spBetaProfile)