Git Product home page Git Product logo

Comments (9)

AliSoftware avatar AliSoftware commented on May 23, 2024

Ha indeed I forgot to expand the ~ in the path. You can fix it by adding
some stringByExpandingTildeInPath in Sources/L10n/main.swift
or use a path that doesn't contain ~ in the meantime

from swiftgen.

AJ9 avatar AJ9 commented on May 23, 2024

Thanks!

from swiftgen.

AliSoftware avatar AliSoftware commented on May 23, 2024

Reopening so I don't forget to add that stringByExpandingTildeInPath call in future versions.

from swiftgen.

delannoyk avatar delannoyk commented on May 23, 2024

Hi,

I'm also getting this issue, except that my path doesn't contain a tilde:
swiftgen-l10n Localizable.strings

// Generated using SwiftGen, by O.Halligon — https://github.com/AliSoftware/SwiftGen

import Foundation

// No line found in Localizable.strings

Do you have any idea what could go wrong? (I'm using brew's version (0.4.4))

from swiftgen.

AliSoftware avatar AliSoftware commented on May 23, 2024

The comment may actually be a bit misleading (I should change it one day) and is generated when there would not be any "case" generated, which could happen indeed if your Localizable.strings is empty, but also if the file is not found (because you mistyped the path or the relative path was not relative to what you thought maybe?), or if the file wasn't readable at all (access rights etc), …

I should probably generate a more explicit comment (or even generate a proper error / exit code maybe) to tell whether it's a "file not found" or "error reading file" or "no problem when reading file but no string found in it" etc.

from swiftgen.

delannoyk avatar delannoyk commented on May 23, 2024

That's strange:

# swiftgen-l10n Localizable.strin
Error: The file “Localizable.strin” couldn’t be opened because there is no such file.

# ls -l
total 16
-rw-r--r--  1 kevindelannoy  staff   244 Sep 26 15:43 InfoPlist.strings
-rw-r--r--@ 1 kevindelannoy  staff  3062 Sep 30 20:30 Localizable.strings

# swiftgen-l10n Localizable.strings
// Generated using SwiftGen, by O.Halligon — https://github.com/AliSoftware/SwiftGen

import Foundation

// No line found in Localizable.strings

I also tried to type in absolute path but I have the same result.

Also, Localisable.strings just contains "test" = "Test123";

from swiftgen.

AliSoftware avatar AliSoftware commented on May 23, 2024

Ah, very strange indeed. Is your Localizable.strings properly saved as a UTF-16 file, not an UTF-8 file? (as that's how Localizable.strings files are expected to be encoded by Xcode anyway)

(Note for self: add better error messages, including for cases where the was couldn't be read because of a bad encoding)

from swiftgen.

delannoyk avatar delannoyk commented on May 23, 2024

Yup, that was encoding!

Thanks @AliSoftware 👍

from swiftgen.

AliSoftware avatar AliSoftware commented on May 23, 2024

Closing as I opened dedicated issues for the UTF8 encoding problem (#21) and the tilde not expanded (#22)

from swiftgen.

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.