rylev / apfel Goto Github PK
View Code? Open in Web Editor NEWA lightweight .strings file parser written in Ruby
License: MIT License
A lightweight .strings file parser written in Ruby
License: MIT License
Like so:
"\".\" Shortcut" = "„.“ Kurzbefehl";
This fails the key value checker:
def key_value_pair?
!!(/^\s*"([^"]+)"\s*=/.match(content))
end
and results to the key-value output being nil
RuntimeError because some of my lines didn't end with ";", while Xcode (or whichever Apple tool handles this) doesn't have any problem with it (not even a warning).
I believe that a "//" comment at the end of a line should be considered a comment belonging to the previous pair if on the same line, whereas when it is on a line of its own it should be attached to the following one instead. Personally I only use #to_hash(with_comments:false)
but for those who do care about keeping comments, this rule would match how people use "//" in any source code that I know.
Also, error messages should say which line of the file it failed in, and ideally which file too, though for the latter it's easier to trace from one's own program, whereas for the line number I had to edit Apfel's dot_strings_parser.rb
to add numbers, e.g.
linenum=0
@read_file.each do |content_line|
linenum+=1
current_line = begin Line.new(content_line)
rescue Exception => e
throw RuntimeError.new("at line #{linenum}: #{e.message}") end
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.