1
0
mirror of https://github.com/dkmstr/openuds-gui.git synced 2025-03-12 08:58:21 +03:00

advancing

This commit is contained in:
Adolfo Gómez García 2018-05-14 13:10:29 +02:00
parent 13d9867f62
commit fc2229259d
4 changed files with 10 additions and 12 deletions

View File

@ -45,7 +45,7 @@ def mkPath(path):
folder = os.path.join(folder, p)
try:
os.mkdir(folder)
except OSError as e:
except OSError:
pass # Already exits, ignore
@ -73,7 +73,7 @@ def fixIndex():
with open(os.path.join(DIST, 'index.html'), 'r', encoding='utf8') as f:
html = f.read()
# include django headers
html = '{% load uds %}{% get_current_language as LANGUAGE_CODE %}' + html
html = '{% load uds i18n %}{% get_current_language as LANGUAGE_CODE %}' + html
with open(os.path.join(os.path.join(UDS, TEMPLATE), 'index.html'), 'w', encoding='utf8') as f:
f.write(translatePattern.sub(translations + jsdata, html))
@ -122,8 +122,13 @@ def createDirs():
mkPath(os.path.join(UDS, STATIC))
mkPath(os.path.join(UDS, TEMPLATE))
#
# def buildSource():
# os.system('ng build --prod --output-hashing=none --aot --deleteOutputPath --build-optimizer --deploy-url /static/modern')
def main():
print('Use "yarn build" to correctly build for UDS')
# buildSource()
createDirs()
extractTranslations()
fixIndex()

View File

@ -6,7 +6,7 @@
"ng": "ng",
"start": "ng serve --host 172.27.0.1 --port 9000 --proxy-config proxy.conf.json",
"build": "ng build --prod --output-hashing=none --aot --deleteOutputPath --build-optimizer --deploy-url /static/modern",
"postbuild": "echo 'Hola'",
"postbuild": "python3 builder.py",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"

View File

@ -16,7 +16,7 @@
</li>
<li class="nav-item dropdown" ngbDropdown>
<a class="nav-link dropdown-toggle" id="dropdown01" ngbDropdownToggle>{{ lang }}</a>
<div class="dropdown-menu" aria-labelledby="dropdown01" ngbDropdownMenu>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown01" ngbDropdownMenu>
<a class="dropdown-item" href="#" *ngFor="let l of langs">{{ l.name }}</a>
</div>
</li>

View File

@ -12,14 +12,7 @@
<script type="text/javascript" src="jsi18n/es.js"></script>
<script type="text/javascript">
var udsConfig = {
language: 'es',
available_languages: [
{id: 'es', name: 'Spanish'},
{id: 'en', name: 'English'},
{id: 'fr', name: 'French'},
{id: 'it', name: 'Italian'},
]
};
"language": "en", "available_languages": [{"name": "Spanish", "id": "es"}, {"name": "English", "id": "en"}, {"name": "French", "id": "fr"}, {"name": "German", "id": "de"}, {"name": "Portuguese", "id": "pt"}, {"name": "Italian", "id": "it"}, {"name": "Basque", "id": "eu"}, {"name": "Arabian", "id": "ar"}, {"name": "Catalan", "id": "ca"}]};
</script>
<!-- ENDDYNAMIC_DATA -->