jim1001 wrote:Does anyone have any advice / recommendations on Git workflow with a LiveCode Levure project?
Yes
I will be giving a presentation on git workflow at the LiveCode Global conference next week:
https://livecode.com/global/#schedule
jim1001 wrote:I’m working alone on a LiveCode Levure project and thinking of using git-flow to further organize my work. A general question seems to be: How do you fit the binary UIs produced with LiveCode into the Git workflow?
As @mikey said, you will still use Git with your binary `ui` stacks. You just won't be able to see granular changes in the ui stacks like you do with the script files. A couple of things:
1. Rather than use substacks, move all ui stacks into individual `ui` components. The more granular your organization the better idea you have of what changed when you make changes to a part of the UI.
2. Make sure you move your scripts out of the binary stack file and into script only stack behaviors.
3. When you do change the UI and make changes to a binary stack file provide a detailed description of what changed in the git commit message.
If you haven't watched the screencast or read the wiki page on `ui` components then make sure you review that as well:
https://github.com/trevordevore/levure/ ... -and-above
jim1001 wrote:Specifically, the app I'm currently producing has to function in two languages, Swedish and English. As well as the UI language difference there will also be language specific audio and video files.
I’ve just started developing in English and at the moment am only using a master branch and backing this up to GitHub. I was thinking to develop one app with a user controlled language switch but maybe with Git could have two separate branches and therefore two separate apps for Swedish & English.
I would not recommend using different branches to manage the languages. I think you can manage the languages using the build profiles in Levure and a translation library. This will be easier than continually merging changes to the main app between the two branches. Here is one idea on how to set things up so that you have a dedicated english app and a dedicated swedish app. This is just an example. I'm not saying that this is the right solution. It may be better to have one app with both languages.
1. Add two new build profiles to the `app.yml` file. One for english and the other for swedish. Each build profile will have a copy files section that copies the relevant files for the target language.
Code: Select all
build profiles:
...
release-en:
copy files:
all platforms:
- filename: english folder
release-sv:
copy files:
all platforms:
- filename: swedish folder
2. Add a library to handle translations. I have a very basic Helper available here:
https://github.com/trevordevore/levurehelper-translate
The helper allows you to store your translation strings in a YAML file located in a `locales` folder. The YAML file consists of keys and values. The key is the identifier used in the `_t()` function. The value is the translation for the currently active locale. The `app.yml` file would be updated like this in order to make sue the proper YAML files are included with the packaged application:
Code: Select all
build profiles:
...
release-en:
copy files:
all platforms:
- filename: ./english assets
- filename: locales/en.yml
release-sv:
copy files:
all platforms:
- filename: ./swedish assets
- filename: locales/sv.yml
3. In `app.livecodescript` set the appropriate locale when the application starts up. You can do that in the `InitializeApplication` handler. The following example sets the language to english unless the version of the app that was packaged using the `release-sv` build profile:
Code: Select all
command InitializeApplication
if levureBuildProfile() is "release-sv" then
translateSetLocale "sv"
else
translateSetLocale "en"
end if
end InitializeApplication