Diff util for language .ini

Currently, most translation projects lack continuous maintenance.

One main reason is that with version updates, it’s difficult to check which fields have been added in .ini files.

Now there is a tool trying to solve this problem

If you can handle Python (It doesn’t need to be too complicated), you can do this:

from aseprite_ini import Aseini

def main():
    # Get the latest main branch en.ini strings 
    strings_en = Aseini.pull_strings('main')
    # Fallback strategy to compat old version, although this may not necessarily be effective
    # Save a standard file for reference

    # Assume, we translate italian
    strings_it = Aseini.load('somedir/it.ini')
    # A simple way to track translation progress
    translated, total = strings_it.coverage(strings_en)
    print(f'progress: {translated} / {total}')
    # Save as a new file that missing line will be add with '# TODO #' prefix 
    strings_it.save('somedir/it-new.ini', strings_en)
    # Create an alphabet, that all letters used in the value. This is very useful for making fonts

if __name__ == '__main__':

Generated files will be like:

title = 警告 - 重要
description = 您正在進入 “高級模式” 。

# TODO # shortcut = Shortcut:
# TODO # right_click = Right-click: Show playback options

all_layers_are_locked = 所有選擇的圖層都已鎖定
# TODO # layer_locked = Layer '{0}' is locked
# TODO # disable_snap_grid = Disable Snap to Grid
# TODO # frame = Frame:
# TODO # current_frame = Current Frame
# TODO # zoom_level = Zoom Level
# TODO # new_frame = New Frame

Then, just replace the # TODO # line with the correct translation, that’s ok.

There is currently an example to refer to:

If you have any ideas, please let me know

1 Like