Skip to content

Commit

Permalink
Remove TranslationUnit concept as Translation is more reliable for su…
Browse files Browse the repository at this point in the history
…ggestion searches
  • Loading branch information
yunussasmaz committed Dec 30, 2014
1 parent cad1166 commit ccc2965
Show file tree
Hide file tree
Showing 19 changed files with 14 additions and 1,054 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,6 @@ generated and downloaded using a {Localizer}.
Article keeps an ordered set of {Key Keys} whereas Commit keeps an unordered
set, so that the exporter can put the Translations back together in the right order.

Because new source copy overwrites existing source copy, a translation memory
consisting of {TranslationUnit TranslationUnits} is maintained. This is used by
the content-matching system to provide match suggestions to translators.

Models make extensive use of advanced PostgreSQL features for efficiency and
convenience. Cached counters are updated using triggers and rules, foreign key
constraints and hooks are enforced at the database level, and validations are
Expand Down

This file was deleted.

78 changes: 0 additions & 78 deletions app/assets/stylesheets/pages/translation_units.scss

This file was deleted.

172 changes: 0 additions & 172 deletions app/controllers/translation_units_controller.rb

This file was deleted.

7 changes: 0 additions & 7 deletions app/models/observers/translation_observer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,14 @@
# This observer on the {Translation} model...
#
# 1. Creates a {TranslationChange} if a {Translation} is changed
# 2. Updates Translation Memory if a translator is updating the {Translation}

class TranslationObserver < ActiveRecord::Observer
def after_commit_on_update(translation)
log_change(translation)
update_translation_memory(translation)
end

private
def log_change(translation)
TranslationChange.create_from_translation!(translation)
end

# Update the Translation memory if a human is updating it.
def update_translation_memory(translation)
TranslationUnit.store(translation) if translation.modifier
end
end
Loading

0 comments on commit ccc2965

Please sign in to comment.