tr8n_client_sdk 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +86 -0
- data/lib/generators/tr8n_client_sdk/tr8n_client_sdk_generator.rb +1 -1
- data/lib/tr8n_client_sdk/engine.rb +1 -1
- data/lib/tr8n_client_sdk/extensions/action_controller_extension.rb +0 -1
- data/lib/tr8n_client_sdk/extensions/action_view_extension.rb +1 -1
- data/lib/tr8n_client_sdk/railtie.rb +1 -1
- data/lib/tr8n_client_sdk/version.rb +2 -2
- data/test/dummy/app/controllers/home_controller.rb +5 -0
- data/test/dummy/app/views/layouts/_header.html.erb +3 -0
- data/test/dummy/config/tr8n/config.yml +2 -0
- data/test/dummy/log/development.log +23405 -0
- data/test/dummy/log/tr8n.log +18317 -14602
- metadata +3 -3
- data/README.rdoc +0 -3
data/README.md
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
# Tr8n Client SDK for Ruby on Rails
|
2
|
+
|
3
|
+
This Client SDK provides all tools and extensions necessary for translating any Rails application using the Tr8n service.
|
4
|
+
|
5
|
+
You can use http://sandbox.tr8nhub.com or download and install the service locally by following these instructions:
|
6
|
+
|
7
|
+
```sh
|
8
|
+
$ git clone https://github.com/tr8n/tr8n.git
|
9
|
+
$ cd tr8n/test/dummy
|
10
|
+
$ bundle install
|
11
|
+
$ rake db:migrate
|
12
|
+
$ rake tr8n:init
|
13
|
+
$ rails s
|
14
|
+
```
|
15
|
+
|
16
|
+
Open your browser and point to:
|
17
|
+
|
18
|
+
http://localhost:3000
|
19
|
+
|
20
|
+
This is your Tr8n Service Instance.
|
21
|
+
|
22
|
+
Now you can install and run the Client SDK sample.
|
23
|
+
|
24
|
+
|
25
|
+
# Runing the Client SDK Sample
|
26
|
+
|
27
|
+
To run the gem as a stand-alone application follow these:
|
28
|
+
|
29
|
+
Make sure you edit the config/tr8n/config.yml file and provide the correct application host, key and secret for your application.
|
30
|
+
|
31
|
+
```sh
|
32
|
+
$ git clone https://github.com/tr8n/tr8n_rails_clientsdk.git
|
33
|
+
$ cd tr8n_rails_clientsdk/test/dummy
|
34
|
+
$ bundle install
|
35
|
+
$ rake db:migrate
|
36
|
+
$ rails s -p 3001
|
37
|
+
```
|
38
|
+
|
39
|
+
Alternatively, you can see the same sample application as a stand alone app:
|
40
|
+
|
41
|
+
https://github.com/tr8n/tr8n_rails_clientsdk_sample
|
42
|
+
|
43
|
+
|
44
|
+
# Integration Instructions
|
45
|
+
|
46
|
+
Here are a few points on how to integrate Tr8n into your app:
|
47
|
+
|
48
|
+
Add the following gems to your Gemfile:
|
49
|
+
|
50
|
+
```ruby
|
51
|
+
gem 'tr8n_core'
|
52
|
+
gem 'tr8n_client_sdk'
|
53
|
+
```
|
54
|
+
|
55
|
+
Install the gems:
|
56
|
+
|
57
|
+
```sh
|
58
|
+
$ bundle
|
59
|
+
```
|
60
|
+
|
61
|
+
Generate config file:
|
62
|
+
|
63
|
+
```sh
|
64
|
+
$ rails g tr8n_client_sdk
|
65
|
+
```
|
66
|
+
|
67
|
+
Open the config file and provide your application credentials:
|
68
|
+
|
69
|
+
```
|
70
|
+
application:
|
71
|
+
host: http://localhost:3000
|
72
|
+
key: YOUR_APP_KEY
|
73
|
+
secret: YOUR_APP_SECRET
|
74
|
+
```
|
75
|
+
|
76
|
+
In the HEAD section of your layout, add:
|
77
|
+
|
78
|
+
```ruby
|
79
|
+
<%= tr8n_scripts_tag %>
|
80
|
+
```
|
81
|
+
|
82
|
+
You are done, tr8n is now running in your app.
|
83
|
+
|
84
|
+
To read more about what you can do with it, visit the wiki site:
|
85
|
+
|
86
|
+
http://wiki.tr8nhub.com
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c)
|
2
|
+
# Copyright (c) 2013 Michael Berkovich, tr8nhub.com
|
3
3
|
#
|
4
4
|
# Permission is hereby granted, free of charge, to any person obtaining
|
5
5
|
# a copy of this software and associated documentation files (the
|
@@ -23,5 +23,5 @@
|
|
23
23
|
|
24
24
|
|
25
25
|
module Tr8nClientSdk
|
26
|
-
VERSION = "1.
|
26
|
+
VERSION = "1.1.0"
|
27
27
|
end
|
@@ -44,6 +44,9 @@
|
|
44
44
|
|
45
45
|
<li class="divider"></li>
|
46
46
|
<li><%= link_to_function tr("Shortcuts"), "Tr8n.UI.Lightbox.show('/tr8n/help/lb_shortcuts', {width:400})" %></li>
|
47
|
+
<% if Tr8n.cache.enabled? and not Tr8n.cache.read_only? %>
|
48
|
+
<li><%= link_to(tr("Upgrade Cache ({num})", :num => Tr8n.cache.version), :controller => :home, :action => :upgrade_cache) %></li>
|
49
|
+
<% end %>
|
47
50
|
|
48
51
|
<li class="divider"></li>
|
49
52
|
<li><%=link_to_function(tr("Logout"), "Tr8n.UI.Lightbox.show('/login/out?mode=lightbox', {width:400});")%></li>
|