wildwinter / Ink-Localiser

Utility to extract strings from an Ink project and assign IDs to them.
MIT License
6 stars 2 forks source link

localiser can only work with one per line #1

Closed meturgut closed 1 month ago

meturgut commented 1 month ago

Hello @wildwinter,

I'm getting following error when I run the tool. What is the problem?

Error: "Error in file story line 5 - two chunks of text when localiser can only work with one per line. Not localised."

Thanks in advance.

- I looked at Monsieur Fogg 
*   ... and I could contain myself no longer.
    'What is the purpose of our journey, Monsieur?' <shake> AAAAA </shake>
    'A wager,' he replied.
    * *     'A wager!'[] I returned.
            He nodded. 
            * * *   'But surely that is foolishness!'
            * * *  'A most serious matter then!'
            - - -   He nodded again.
            * * *   'But can we win?'
                    'That is what we will endeavour to find out,' he answered.
            * * *   'A modest wager, I trust?'
                    'Twenty thousand pounds,' he replied, quite flatly.
            * * *   I asked nothing further of him then[.], and after a final, polite cough, he offered nothing more to me. <>
    * *     'Ah[.'],' I replied, uncertain what I thought.
    - -     After that, <>
*   ... but I said nothing[] and <>
- we passed the day in silence.
- -> END
wildwinter commented 1 month ago

I can't believe I haven't documented this. Sorry.

As it says, the tool can only work with one text fragment per line, as it relies on tagging and you can't tag different sections of a line.

Your syntax has [] which is essentially splitting your option into two separate text objects.

Not only is this hard for the tool to deal with, dealing with fragmentary strings is very hard for localisers to deal with in translation, so it's not something typically I've ever required or recommended.

Apologies - the tool doesn't support that sort of structure for both those reasons.

I will document that properly though!

meturgut commented 1 month ago

Thanks for quick answer @wildwinter . No problem, i understood. Actually it's a demo ink file from unity integration package. Most probably i won't use the syntax '[]' as well.

What should be the process of string localization when we extract the ids with this tool? I couldn't fully understand the purpose of extracting these ids.

meturgut commented 1 month ago

Now I understand after re-reading the following lines:

Look for any tag starting with #id:, parse the ID from that tag yourself, and ask your CSV or JSON file for the actual string. You can use the same ID to trigger an appropriate voice line, if you've recorded one.

In other words - during runtime, just use Ink for logic, not for content. Grab the tags from Ink, and use your external text file (or WAV filenames!) as appropriate for the relevant language.

Are there any problems when using variables,functions,expressions etc.?

wildwinter commented 1 month ago

Generally there shouldn't be any problems, except that if for some reason you define strings inside functions they will be ignored. Again, they are untaggable.

But this comes back to an underlying issue that although Ink is good at assembling text out of fragments, that's very difficult for a translator to work with as their language might not construct a sentence in the same way. It's also not useful for a game which has recorded audio - voice acting works in whole lines, not assemblies of fragments.

So this system is targeted at games which deliberately use a subset of Ink, working in whole sentences.

Hope that makes sense!

wildwinter commented 1 month ago

Updated docs!