larsiusprime / firetongue

A translation/localization framework written in Haxe
MIT License
143 stars 32 forks source link

Firetongue library is deprecated? #36

Open FileEX opened 5 years ago

FileEX commented 5 years ago

Hi, i try import firetongue into my code, but when i want compile, i got error "

Unexpected tongue

in this line tongue.init("en-US",onLoaded); When i was try run samples from master and dev branch, i was got error

Master branch:

D:/HaxeToolkit/haxe/lib/firetongue/2,0,0/firetongue/FireTongue.hx:530: characters 13-28 : Class has no field load

Dev branch:

D:/HaxeToolkit/haxe/lib/firetongue/2,0,0/firetongue/FireTongue.hx:530: characters 13-28 : Class has no field load Source/Main.hx:164: characters 6-25 : firetongue.FireTongue has no field missingFiles (Suggestions: missing_files, _missing_files, missing_flags) Source/Main.hx:167: characters 49-68 : firetongue.FireTongue has no field missingFiles (Suggestions: missing_files, _missing_files, missing_flags) Source/Main.hx:169: characters 16-35 : firetongue.FireTongue has no field missingFiles (Suggestions: missing_files, _missing_files, missing_flags) Source/Main.hx:169: characters 16-35 : You can't iterate on a Dynamic value, please specify Iterator or Iterable Source/Main.hx:175: characters 6-25 : firetongue.FireTongue has no field missingFlags (Suggestions: missing_flags, _missing_flags) Source/Main.hx:177: characters 22-41 : firetongue.FireTongue has no field missingFlags (Suggestions: missing_flags, _missing_flags) Source/Main.hx:184: characters 15-34 : You can't iterate on a Dynamic value, please specify Iterator or Iterable Source/Main.hx:78: characters 34-56 : flash.display.BitmapData should be String Source/Main.hx:78: characters 34-56 : openfl.display.BitmapData should be String Source/Main.hx:78: characters 34-56 : For function argument 'id' Source/Main.hx:80: characters 40-53 : Float should be Int Source/Main.hx:80: characters 40-53 : For function argument 'width'

My code:

package;

import flixel.FlxGame;
import openfl.display.Sprite;
import firetongue.FireTongue;
import firetongue.Replace;

class Main extends Sprite
{
    var tongue:FireTongue = new FireTongue();
    tongue.init("en-US",onLoaded);

    public function new()
    {
        super();
        addChild(new FlxGame(0, 0, SplashScreen));
    }

    function onLoaded():Void{
        trace(tongue.get("$NEW_GAME","ui"));
    }
}

I have included this library in project.xml

<haxelib name="firetongue"/>
larsiusprime commented 5 years ago

Hmmm, looks like OpenFL might have had some recent changes or something? What versions of Haxe, OpenFL and Lime are you using? I'll try to fix this soon.

On Sun, Apr 7, 2019 at 9:50 PM FileEX notifications@github.com wrote:

Hi, i try import firetongue into my code, but when i want compile, i got error "

Unexpected tongue

" in this line ```haxe tongue.init("en-US",onLoaded);

Master branch:

D:/HaxeToolkit/haxe/lib/firetongue/2,0,0/firetongue/FireTongue.hx:530: characters 13-28 : Class has no field load

Dev branch:

D:/HaxeToolkit/haxe/lib/firetongue/2,0,0/firetongue/FireTongue.hx:530: characters 13-28 : Class has no field load Source/Main.hx:164: characters 6-25 : firetongue.FireTongue has no field missingFiles (Suggestions: missing_files, _missing_files, missing_flags) Source/Main.hx:167: characters 49-68 : firetongue.FireTongue has no field missingFiles (Suggestions: missing_files, _missing_files, missing_flags) Source/Main.hx:169: characters 16-35 : firetongue.FireTongue has no field missingFiles (Suggestions: missing_files, _missing_files, missing_flags) Source/Main.hx:169: characters 16-35 : You can't iterate on a Dynamic value, please specify Iterator or Iterable Source/Main.hx:175: characters 6-25 : firetongue.FireTongue has no field missingFlags (Suggestions: missing_flags, _missing_flags) Source/Main.hx:177: characters 22-41 : firetongue.FireTongue has no field missingFlags (Suggestions: missing_flags, _missing_flags) Source/Main.hx:184: characters 15-34 : You can't iterate on a Dynamic value, please specify Iterator or Iterable Source/Main.hx:78: characters 34-56 : flash.display.BitmapData should be String Source/Main.hx:78: characters 34-56 : openfl.display.BitmapData should be String Source/Main.hx:78: characters 34-56 : For function argument 'id' Source/Main.hx:80: characters 40-53 : Float should be Int Source/Main.hx:80: characters 40-53 : For function argument 'width'

My code:


package;

import flixel.FlxGame;
import openfl.display.Sprite;
import firetongue.FireTongue;
import firetongue.Replace;

class Main extends Sprite
{
  var tongue:FireTongue = new FireTongue();
  tongue.init("en-US",onLoaded);

  public function new()
  {
      super();
      addChild(new FlxGame(0, 0, SplashScreen));
  }

  function onLoaded():Void{
        trace(tongue.get("$NEW_GAME","ui"));
    }
}

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://github.com/larsiusprime/firetongue/issues/36>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAtG-DfHx_dcXKpgPt-q2PpflUgcNRb_ks5veq6DgaJpZM4chMaa>
.

-- www.fortressofdoors.com -- My design & business of game development blog

FileEX commented 5 years ago

Lime version 7.3.0, haxe version 3.4.7, OpenFL version 8.9.0

larsiusprime commented 5 years ago

That might be it, I'm on OpenFL 8.8.0.

Lemme check 8.9's changelog.

On Mon, Apr 8, 2019 at 12:32 PM FileEX notifications@github.com wrote:

Lime version 7.3.0, haxe version 3.4.7, OpenFL version 8.9.0

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/larsiusprime/firetongue/issues/36#issuecomment-480928466, or mute the thread https://github.com/notifications/unsubscribe-auth/AAtG-KGB6IG-IDnpXeenG5ViXQ0OmIlFks5ve301gaJpZM4chMaa .

-- www.fortressofdoors.com -- My design & business of game development blog

larsiusprime commented 5 years ago

Yeah, hard to pin down exactly when it happened, but latest OpenFL 8 doesn't have a load() function in BitmapData -- now they have loadFromBytes, loadFromFile, etc. I'll try to fix this soon.