Coder Social home page Coder Social logo

Comments (9)

lunarcloud avatar lunarcloud commented on July 30, 2024

What's wrong with just having story.en.ink and story.ptbr.ink etc?
Is it the localization services that really want a CSV the issue?
Honestly curious.

from godot-ink.

joethephish avatar joethephish commented on July 30, 2024

Yes, localisation services is one problem, though some devs have used exactly the approach you describe.

The elegant thing about the yarn spinner approach is that it means that you can insert new lines and do edits while retaining the original IDs, and know which content has changed. It also means that you have a separation of logic and content, meaning that localised files won’t accidentally go out of sync if the logic changes.

from godot-ink.

lunarcloud avatar lunarcloud commented on July 30, 2024

Sounds logical, though "which content has changed" seems like a job for git.

I've gone through the pain of simple key-value pair localization (angular json i18n) getting out of sync, so the task is just plain error-prone without vigilance imho.

But any feature that can make it easier is welcome if it works :)

from godot-ink.

joethephish avatar joethephish commented on July 30, 2024

Yeah I wondered about making use of git to detect changes and to understand a sort of line number independent persistence. But despite the ubiquity of git, maybe it feels like an overly strong dependency? Like, lots of game teams like Perforce for example. But it would certainly be a cleverly elegant approach.

When you say key value persistence, are the keys the original language content, or some ID? (I would prefer not to use the original content since it could depend on context of nearby other content)

In any case, not a small undertaking by any means.

from godot-ink.

paulloz avatar paulloz commented on July 30, 2024

Also, I doubt this should be implemented in an integration package. Looks like an issue for the main ink repo πŸ˜…
Translation is a big issue with ink games for now tho.

from godot-ink.

Sekitan avatar Sekitan commented on July 30, 2024

Me again, so I'm trying to implement a simple localization method where I am trying to set and load the story through gdscript. However I can't get it to work:
story.InkFile = 'res://Ink/my_story_en.json'
story.LoadStory()

Doesn't load anything. Only setting the story through the inspector, checking autoload, and commenting out the two lines above does the story properly load.
If I set it in the inspector and leave these two lines active the story doesn't load either.

Sorry if this is off-topic but what gives?

from godot-ink.

paulloz avatar paulloz commented on July 30, 2024

@Sekitan Hi! It's totally off-topic but no worries πŸ˜€
The issue here is that .InkFile should not contain a path to a file but the actual Godot resource object.

story.InkFile = ResourceLoader.load("res://Ink/my_story_en.json")
story.LoadStory()

I'm opening an issue to provide better error messages, I think it's something we're lacking here (and was hard to spot when I was the only person using this integration πŸ˜…): #18

from godot-ink.

Sekitan avatar Sekitan commented on July 30, 2024

Appreciated!

So my basic localization method works like this:
First, have all your .json/.ink files end in _lanuage.json for example _en.json or _fr.json.
So your file path would look something like res://Ink/my_story_en.json

Next, instead of typing:
story.InkFile = ResourceLoader.load("res://Ink/my_story_en.json")
Do this:
story.InkFile = ResourceLoader.load(dialog_file + localization)
dialog_file is a string that holds a string of the story name without the end:
var dialog file = "res://Ink/my_story"
localization is a string that changes according to what language the player selects.
var localization = "_en.json" or var localization = "_fr.json", etc.

This setup takes some micromanagement and you need a .json/.ink file per translation but as long as you remember to name and reference the files correctly it will load the right translation automatically.

from godot-ink.

paulloz avatar paulloz commented on July 30, 2024

Nice, you might want to be cautious about changing language mid-story or that kind of things.
If that's OK, I'm going to close this issue because it's not really related to this repository.
Feel free to continue commenting here if need be.

from godot-ink.

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.