Comments (9)
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.
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.
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.
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.
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.
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.
@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.
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.
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)
- Included Ink files doesn't cause the Ink Story to be recompiled correctly HOT 2
- Move to Godot 4.2
- Expose onError handler method
- plugin.gd Error: Mixed use of tabs and spaces for indentation
- Calling RemoveParagraph() in MetaClicked event within RichTextLabel crashes Godot HOT 1
- Update quickstart guide with platform info HOT 3
- Ink import gets deleted/FileSystem pane no longer displays Ink files HOT 2
- Addons disabbling itself sometimes on Godot 4.2 .Net HOT 1
- InkStory isn't a GlobalClass when using Godot 4.2 HOT 2
- Unable to export release builds due to missing assembly reference HOT 5
- i can not find the .csproj file in my godot4.2 HOT 12
- Iterating Ink List content after FetchVariable? HOT 3
- Error calling InkChoice GetTags() via GDScript Interop HOT 1
- Plugins do not work in 4.1.1 HOT 2
- InitializeRuntimeStory is never called when passing in Ink Json String HOT 3
- 4.2.2 GDScript Interop issue HOT 1
- Can't find the Story property in the inspector HOT 3
- TagsForContentAtPath function doesn't work in GDScript. HOT 2
- Get all story variables HOT 1
- Calling an ink function bound using BindExternalFunction to a gdscript lambda function fails. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from godot-ink.