rails i18n rename key [closed] - ruby-on-rails

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I work on a project translated to over 20 languages. I need to rename some keys, i.e. 'some.key.with.deep.nesting' to 'this.lives.in.another.place'. How do I do it? Manually moving parts of tree in YAMLs 20 times for each is too long and tedious. Are there some standard practices for managing i18n in Rails?
Official guide (http://guides.rubyonrails.org/i18n.html) explains how to start with i18n, but says nothing about managing translations.
There are some external solutions like localeapp.com, but last time i tested it, it failed to rename keys.
There are also projects like copycopter, i haven't installed it yet, but in description there's also nothing about renaming keys.
So what do you use to manage, rename, move and reorganize your locales?

Localeapp allows you to rename keys easily — you just need to press the additional options button:
And it does so for all your locales at once. Perhaps this feature was added after you tried it — it is beta after all.

If you don't mind your i18n files being mangled you can just use the console to read them in with a yaml parser, move the hashes around and dump it out to files again with a yaml encoder.

For translation management in rails you can give phraseapp a try. It provides an in-place editor as well as key management.

copycopter is just for this.
https://github.com/copycopter/copycopter-server
Here is also a rails cast
http://railscasts.com/episodes/336-copycopter

Related

How to publish and implement Ruby file to my website [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm a beginner of Ruby. I want to establish my website by programming with Ruby language.
Before that, I used to upload HTML files to my web-host server, so that I could update my website. But now I have no idea about what should I do with Ruby file.
Thank you!
If you are using the rails framework you may wanna try using cloud9 instead. Brackets from what i understand is "local". Whereas cloud9 is a "real" IDE. Additionally you can easily push your code to heroku where your code will be hosted at.
To get things started just head over to cloud9 to create an account to setup your IDE. If you are unfamiliar with it there are lots of guides out there that can help you to get things started.
However if you lack the fundamentals in using the rails framework, guides.rubyonrails.org may be a good place to start too.
Update:
There is no best language when it comes to developing a website. The fundamentals of a webpage are HTML/CSS.
HTML gives you the bones or structure, such as your titles and your paragraphs etc.
CSS gives you your styling, such as creating buttons or changing font color etc.
This 2 languages form the core part of what would be your website, at the very least on the front end (meaning to say what people see when they visit your website)
JavaScript is not a must but definitely a plus. It is able to improve the UI/UX (user interface/user experience) of your website.
Lastly would be your back-end language; what handles the processes that goes on behind the scenes. If you choose ruby (and by extension rails) then that is fine as well. Basically your back-end language will support your database and CRUD (create, read, update, delete) actions.

Go concurrency in Ruby [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I wish to use threads and concurrency features of Go language in my Ruby on Rails project. I have several alternatives, one of them is jRuby. But, I don't like Java (personal preference). I have heard that Go Lang is a perfect replacement for Java. Its even more faster & secure than Java. I saw people comparing its speed to C++ as some of its part is in Assembly itself. People can even write a complete web server like Apache from scratch in Go.
What I am really planning for is: All the low level stuff in Go and rest of it Ruby on Rails. I still want to have the ease of development that RoR has to offer.
Starting in Go 1.5, there is a build mode called c-shared, which allows you to build C shared libraries in Go. These can then be loaded into Ruby using FFI and used in your Rails app. See this brief introduction to the concept.

Is there a reason why Rails' Core Extensions haven't been incorporated into Ruby lang? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Just curious, if there is a particular reason why some of Rails' convenient Core Extensions (e.g. - #blank?, #present?, #exclude?, and perhaps even String-only utilities like #truncate) haven't been ported directly into the Ruby language?
I understand that methods like #blank? exist almost solely for cosmetics, and yeah, there are the ActiveSupport gems, but it just feels so dirty to write lines like if !include?(a). Perhaps the Ruby-lang-powers-at-hand don't merge in anything cosmetic (similar to the Rails contribution policy), and only support the further, slightly monopolistic, solidification of existing code? Alternatively there may just be a lack of man-power in moving it out to a C-extension, being an open-source project... but I highly doubt that.
Manpower prioritization.
Ruby 2.x has these major improvements:
Optimization e.g. garbage collection, regexp engine, method caching.
Upgrade primitive-equivalents, e.g. Unicode strings, rational numbers.
Update libraries, e.g. psych, rake, rdoc, gem, minitest.
Improve debugging capabilities, e.g. object allocation tracing, exception causes.
Improve developer semantics, e.g. method prepend, refinements, keyword args.
These are currently more valuable than adding methods like #blank? to the core language.

Which is a better gem for indextank? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am using indextank with heroku. Which is a better gem to use, indextank or thinkingtank? I looked at the documentation, and tutorials for both,and it seems like thinkingtank is easier to use. A related/follow up question: what are the advantages/disadvantages of each?
It depends on what you're doing. If you are writing a simple app that's not based on ActiveRecord, the indextank client lets you add and search content without storing anything within your app. An example: if you are fetching tweets, you could index them directly without having a data model on your side. It's more "low level", so to speak.
If you are using ActiveRecord or another ORM, you should take a look at Tanker, it's more actively developed than ThinkingTank:
https://github.com/kidpollo/tanker
Hope this answers your question, if not please come chat with us at http://indextank.com (chat widget on the main page) and we'll be happy to help!
As Diego said, Tanker does seem like it has much going for it. Alternatively you could use IndexTanked:
https://github.com/zencoder/index-tanked
We wrote this library to power search on zencoder.com. Documentation is non-existant so far, but is coming.
One important feature included in IndexTanked, that was a necessity for us, was fault-tolerance. IndexTanked includes configurable fallback methods for use in case of failure to index, delete from the index, or search. Additionally, it limits calls to indextank by checking if the indexed fields have changed on updates. You can even obtain which fields we're checking against so you can select the minimum viable fields to be indexed when needed.
You can drop the author, Adam, a line at adam#zencoder.com if you have an questions (perfectly reasonable with the lack of docs).

include a .tex file with spaces in the filename [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am including chapters in my latex file one by one by using the \include{} statement, up till now I've had no problem with that. But I've recently written a chapter which I've saved under a name including spaces...because you can.
Now the include{} statement apparently doesn't like spaces, and prints just the filename in my document in stead of the chapter.
It is probably a pretty easy fix (apart from removing the spaces in the filename, ;-) ), but I can't find it.
UPDATE
It doesn't bode well for this question according to this wiki. It says that you can't unless you use a recent distribution like teTeX 3 or MikTeX 2.4.
However one smidge of hope left, the page is dated 2005 (a lot can happen in 5 years) and I am using pdflatex included in ubuntu which I assume is a fairly recent distribution.
Try
\include{"file\space name"}
(I.e., use quotes and \space.) You may need to remove old .aux files and/or run Latex twice.
Well I'm closing this question by giving the (quite unsatisfying) answer, I've found (on this wiki).
At the moment the answer unfortunately is: you can't, unless you use a recent version which happens to handle this problem more gracefully. Examples: teTeX 3 and MikTeX 2.4.
It seems that unusual filenames are still a problem within latex, so your best bet is to abstain or, if you have to, find a version that has solved the problem.
It works. What you need to do is if your chapter file is File Of Mine.tex then in the main .tex file put
\include{"File\space Of\space Mine"}
but inside File Of Mine.tex you just need to have \chapter{File Of Mine}. Try this and see if it works for you. It does for me.

Resources