Giter VIP home page Giter VIP logo

Comments (3)

mistercrunch avatar mistercrunch commented on August 28, 2024

Ha! "La connection a fiere allure" FTW :) Sensationel!

from superset.

mistercrunch avatar mistercrunch commented on August 28, 2024

I'm trying to diff to see what changed ->

git diff cc2f6f1ed9 cc2f6f1ed9^ superset/translations/fr/LC_MESSAGES/messages.po

but the git differ isn't anchoring in the right places to show the differences properly, so it's hard to assess whether the edits are all bad or only a subset

trying to do a more custom diff here using a python script against the 2 json

extracting the 2 jsons

# checkout the after file
git checkout cc2f6f1ed9 && cp superset/translations/fr/LC_MESSAGES/messages.json /tmp/after.json
# checkout the before file
git checkout cc2f6f1ed9^ && cp superset/translations/fr/LC_MESSAGES/messages.json /tmp/before.json

compare the before/after (thanks gpt!)

import json

# Load JSON data from files
def load_json(filename):
    with open(filename, 'r', encoding='utf-8') as file:
        return json.load(file)

# Compare the translations in two JSON objects
def compare_translations(data1, data2):
    results = []
    for key in data1["locale_data"]["superset"]:
        if key and key in data2["locale_data"]["superset"]:
            translation1 = data1["locale_data"]["superset"][key][0]
            translation2 = data2["locale_data"]["superset"][key][0]
            if translation1 != translation2:
                results.append({
                    "english_source_sentence": key,
                    "french_from_file1": translation1,
                    "french_from_file2": translation2
                })
    return results

# Main function to run the comparison
def main():
    file1_data = load_json('before.json')
    file2_data = load_json('after.json')
    differences = compare_translations(file1_data, file2_data)
    print(json.dumps(differences, ensure_ascii=False, indent=2))

if __name__ == "__main__":
    main()

sample of the output:

  {
    "english_source_sentence": "You are importing one or more saved queries that already exist. Overwriting might cause you to lose some of your work. Are y
ou sure you want to overwrite?",
    "french_from_file1": "Vous importez une ou plusieurs requêtes sauvegardées qui existent déjà. L'écrasement peut vous conduire à perdre une partie de vot
re travail. Etes-vous sûr de vouloir ce remplacement ?",
    "french_from_file2": "Vous importez une ou plusieurs requêtes enregistrées qui existent déjà. L'écrasement pourrait vous faire perdre une partie de votr
e travail. Êtes-vous sûr de vouloir les écraser?"
  },
  {
    "english_source_sentence": "Link Copied!",
    "french_from_file1": "Lien copié !",
    "french_from_file2": "Lien copié!"
  },
  {
    "english_source_sentence": "There was an issue deleting the selected queries: %s",
    "french_from_file1": "Il y a eu un problème lors de la suppression de requêtes sélectionnées : %s",
    "french_from_file2": "Il y a eu un problème lors de la suppression des requêtes sélectionnées : %s"
  },
  {
    "english_source_sentence": "Delete query",
    "french_from_file1": "Effacer la requête",
    "french_from_file2": "Supprimer la requête"
  },
  {
    "english_source_sentence": "Are you sure you want to delete the selected queries?",
    "french_from_file1": "Ete-vous sûr de vouloir supprimer les requêtes sélectionnées ?",
    "french_from_file2": "Voulez-vous vraiment supprimer les requêtes sélectionnées?"
  },

Overall seemed good to me. I'd hate to revert the whole thing.

from superset.

mistercrunch avatar mistercrunch commented on August 28, 2024

Looks like there are close to 2 thousand edits here and mostly looks much better than what was there before, though I spent more time writing the code than reviewing the french.

Tagging @Ralkion for input

from superset.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.