proSoar icon indicating copy to clipboard operation
proSoar copied to clipboard

Solving build problems and english language

Open GliderGeek opened this issue 9 years ago • 10 comments

There were some steps missing in the build process and some errors:

  • missing packages in ubuntu
  • deprecated skylines url
  • missing english language .po file
  • mootools core package download location These are fixed with these commits

GliderGeek avatar Jan 17 '16 20:01 GliderGeek

This solves issues #4 and #18

GliderGeek avatar Jan 17 '16 20:01 GliderGeek

seems a reasonable approach indeed. the issue remains of the mixed english/germand text on the hosted version though. could this be because of these defaults handling?

GliderGeek avatar Jan 17 '16 22:01 GliderGeek

tried again: ubuntu chrome and firefox. it is not working without the en.json file.

GliderGeek avatar Jan 17 '16 22:01 GliderGeek

my guess is indeed that in these cases german strings were used as the original strings which is obviously wrong. if that is not the case then there must be a problem somewhere else but I'm reasonably certain by now that the en.json file should not be needed.

FYI other translation tools use IDs instead of translatable strings and in these cases you will need a dedicated ID-to-English conversion. gettext however is not using IDs so we shouldn't need it here.

@TobiasLohner any comments on this?

Turbo87 avatar Jan 17 '16 23:01 Turbo87

what's the downside of creating an en.json file? i understand that it is undesirable to create an extra en.po file, but it is possible to create the en.json file from the messages.pot file:

# prepare translations
print "Converting .po to .json and copying them to " + web_temp_dir
translations_folder = os.path.join('..', 'prosoar', 'translations')
for translation in os.listdir(translations_folder):
    if translation == 'messages.pot':
        po_file = os.path.join(translations_folder,'messages.pot')
        translation = 'en'
    elif len(translation) != 2:
        continue
    else:
        po_file = os.path.join(translations_folder, translation,'LC_MESSAGES', 'messages.po')

    result = u'{"%s":%s}' % (translation, pojson.convert(po_file))

    path = os.path.join(web_temp_dir, 'LC_MESSAGES', translation + '.json')
    file(path, 'w').write(result.encode('utf-8'))

GliderGeek avatar Jan 17 '16 23:01 GliderGeek

the downside is that more information has to be downloaded by the client's browser and in this case it is unnecessary because all the information already exists

Turbo87 avatar Jan 18 '16 00:01 Turbo87

But this is already the case for all other languages right?

GliderGeek avatar Jan 18 '16 13:01 GliderGeek

with the exception that for those it is necessary :wink:

Turbo87 avatar Jan 18 '16 13:01 Turbo87

Thanks for your contributions, but I probably won't merge them as I'm currently working on a task planner for SkyLines and would abandon proSoar instead.

It's not finished yet but it's not far until we have the features proSoar has. skylines_task

TobiasLohner avatar Jan 18 '16 20:01 TobiasLohner

That looks very nice @TobiasLohner! Will it also be possible to upload a cup file?

GliderGeek avatar Jan 18 '16 21:01 GliderGeek