diff --git a/app/assets/javascripts/app/views/publisher_view.js b/app/assets/javascripts/app/views/publisher_view.js index dfe527354..f357cb2a6 100644 --- a/app/assets/javascripts/app/views/publisher_view.js +++ b/app/assets/javascripts/app/views/publisher_view.js @@ -285,7 +285,7 @@ app.views.Publisher = Backbone.View.extend({ var pollAnswersArray = _.flatten([serializedForm["poll_answers[]"]]); var pollAnswers = _.map(pollAnswersArray, function(answer){ if (answer) { - return { "answer" : answer }; + return {"answer": answer, "vote_count": 0}; } }); pollAnswers = _.without(pollAnswers, undefined); diff --git a/app/assets/javascripts/helpers/i18n.js b/app/assets/javascripts/helpers/i18n.js index f273165d4..42bd7a886 100644 --- a/app/assets/javascripts/helpers/i18n.js +++ b/app/assets/javascripts/helpers/i18n.js @@ -20,12 +20,11 @@ Diaspora.I18n = { updateLocale: function(locale, data) { locale.data = $.extend(locale.data, data); - var rule = this._resolve(locale, ['pluralization_rule']); - if (rule !== "") { - /* jshint evil:true */ - // TODO change this to `locale.pluralizationKey = rule`? + var rule = locale.data.pluralization_rule; + if (typeof rule !== "undefined") { + /* eslint-disable no-eval */ eval("locale.pluralizationKey = "+rule); - /* jshint evil:false */ + /* eslint-enable no-eval */ } }, @@ -46,14 +45,9 @@ Diaspora.I18n = { : locale.data[nextNamespace]; if(typeof translatedMessage === "undefined") { - if (typeof locale.fallback === "undefined") { - return ""; - } else { - return this._resolve(locale.fallback, originalItems); - } + throw new Error("Missing translation: " + originalItems.join(".")); } } - return translatedMessage; }, @@ -68,7 +62,7 @@ Diaspora.I18n = { return _.template(this._resolve(locale, items))(views || {}); } catch (e) { if (typeof locale.fallback === "undefined") { - return ""; + throw e; } else { return this._render(locale.fallback, originalItems, views); } @@ -86,4 +80,3 @@ Diaspora.I18n = { } }; // @license-end - diff --git a/app/assets/templates/single-post-viewer/single-post-actions_tpl.jst.hbs b/app/assets/templates/single-post-viewer/single-post-actions_tpl.jst.hbs index 16d351e67..9173a1bba 100644 --- a/app/assets/templates/single-post-viewer/single-post-actions_tpl.jst.hbs +++ b/app/assets/templates/single-post-viewer/single-post-actions_tpl.jst.hbs @@ -1,6 +1,6 @@
{{#if loggedIn}} - + {{#if userLike}} {{else}} @@ -8,12 +8,12 @@ {{/if}} - + {{#if userCanReshare}} - + {{else}} diff --git a/app/helpers/language_helper.rb b/app/helpers/language_helper.rb index 13ef1b5c1..1b890ad34 100644 --- a/app/helpers/language_helper.rb +++ b/app/helpers/language_helper.rb @@ -1,4 +1,6 @@ module LanguageHelper + include ApplicationHelper + def available_language_options options = [] AVAILABLE_LANGUAGES.each do |locale, language| diff --git a/app/views/admins/user_search.html.haml b/app/views/admins/user_search.html.haml index 91a516ceb..52638f4d1 100644 --- a/app/views/admins/user_search.html.haml +++ b/app/views/admins/user_search.html.haml @@ -46,7 +46,7 @@ = text_field_tag "identifier", nil, class: "form-control" .form-group .clearfix.col-md-12 - = submit_tag t("services.remote_friend.invite"), class: "btn btn-default pull-right" + = submit_tag t(".invite"), class: "btn btn-default pull-right" .row .col-md-12 diff --git a/app/views/aspect_memberships/_aspect_membership_dropdown.mobile.haml b/app/views/aspect_memberships/_aspect_membership_dropdown.mobile.haml index 958de0740..02ebe2e48 100644 --- a/app/views/aspect_memberships/_aspect_membership_dropdown.mobile.haml +++ b/app/views/aspect_memberships/_aspect_membership_dropdown.mobile.haml @@ -1,7 +1,7 @@ %div %select.aspect_dropdown.form-control.user_aspects{"name" => "user_aspects", "data-person-id" => @person.id} %option{value: 'list_cover', class: 'list_cover', disabled: 'true', selected: 'true'} - = t("add_contact") + = t("contacts.index.add_contact") - contact = current_user.contact_for(@person) - current_user.aspects.each do |aspect| - if contact.try(:in_aspect?, aspect) diff --git a/app/views/contacts/_header.html.haml b/app/views/contacts/_header.html.haml index 56107363e..e6059e005 100644 --- a/app/views/contacts/_header.html.haml +++ b/app/views/contacts/_header.html.haml @@ -13,9 +13,9 @@ -if AppConfig.chat.enabled? = link_to aspect_toggle_chat_privilege_path(@aspect), id: "chat_privilege_toggle", class: "contacts_button", method: :put, remote: true do -if @aspect.chat_enabled? - %i.entypo-chat.enabled.contacts-header-icon{title: t("aspects.edit.aspect_chat_is_enabled")} + %i.entypo-chat.enabled.contacts-header-icon{title: t("javascripts.contacts.aspect_chat_is_enabled")} -else - %i.entypo-chat.contacts-header-icon{title: t("aspects.edit.aspect_chat_is_not_enabled")} + %i.entypo-chat.contacts-header-icon{title: t("javascripts.contacts.aspect_chat_is_not_enabled")} = link_to @aspect, method: "delete", data: { confirm: t("aspects.edit.confirm_remove_aspect") }, class: "delete contacts_button", id: "delete_aspect" do %i.entypo-trash.contacts-header-icon{title: t("delete")} diff --git a/config/application.rb b/config/application.rb index 9c805b337..3df893bbe 100644 --- a/config/application.rb +++ b/config/application.rb @@ -107,6 +107,8 @@ module Diaspora } config.action_mailer.asset_host = AppConfig.pod_uri.to_s + config.action_view.raise_on_missing_translations = true + config.middleware.use Rack::OAuth2::Server::Resource::Bearer, "OpenID Connect" do |req| Api::OpenidConnect::OAuthAccessToken .valid(Time.zone.now.utc).find_by(token: req.access_token) || req.invalid_token! diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 36e2b39d8..9741bac84 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -21,9 +21,6 @@ en: delete: "Delete" hide: "Hide" ignore: "Ignore" - undo: "Undo?" - or: "or" - ago: "%{time} ago" username: "Username" email: "Email" password: "Password" @@ -39,8 +36,6 @@ en: find_people: "Find people or #tags" _home: "Home" more: "More" - next: "Next" - previous: "Previous" _comments: "Comments" all_aspects: "All aspects" no_results: "No results found" @@ -123,6 +118,7 @@ en: account_locking_scheduled: "The account of %{name} is scheduled to be locked. It will be processed in a few moments..." account_unlocking_scheduled: "The account of %{name} is scheduled to be unlocked. It will be processed in a few moments..." email_to: "Email to invite" + invite: "Invite" under_13: "Show users that are under 13 (COPPA)" users: zero: "%{count} users found" @@ -174,11 +170,6 @@ en: tag_name: "Tag name: %{name_tag} Count: %{count_tag}" pods: pod_network: "Pod network" - application: - helper: - unknown_person: "Unknown person" - video_title: - unknown: "Unknown video title" aspects: contacts_visible: "Contacts in this aspect will be able to see each other." contacts_not_visible: "Contacts in this aspect will not be able to see each other." @@ -191,12 +182,8 @@ en: rename: "Rename" aspect_list_is_visible: "Contacts in this aspect are able to see each other." aspect_list_is_not_visible: "Contacts in this aspect are not able to see each other." - aspect_chat_is_enabled: "Contacts in this aspect are able to chat with you." - aspect_chat_is_not_enabled: "Contacts in this aspect are not able to chat with you." update: "Update" updating: "Updating" - no_posts_message: - start_talking: "Nobody has said anything yet!" no_contacts_message: you_should_add_some_more_contacts: "You should add some more contacts!" try_adding_some_more_contacts: "You can search or %{invite_link} more contacts." @@ -233,13 +220,6 @@ en: donate: "Donate" keep_pod_running: "Keep %{pod} running fast and buy servers their coffee fix with a monthly donation!" keep_diaspora_running: "Keep diaspora* development fast with a monthly donation!" - no_tags: "+ Find a tag to follow" - unfollow_tag: "Stop following #%{tag}" - handle_explanation: "This is your diaspora* ID. Like an email address, you can give this to people to reach you." - no_contacts: "No contacts" - post_a_message: "Post a message >>" - people_sharing_with_you: "People sharing with you" - welcome_to_diaspora: "Welcome to diaspora*, %{name}!" introduce_yourself: "This is your stream. Jump in and introduce yourself." @@ -265,10 +245,6 @@ en: any_problem: "Got a problem?" contact_podmin: "Contact the administrator of your pod!" mail_podmin: "Podmin email" - diaspora_id: - heading: "diaspora* ID" - content_1: "Your diaspora* ID is:" - content_2: "Give it to anyone and they’ll be able to find you on diaspora*." services: heading: "Connect services" content: "You can connect the following services to diaspora*:" @@ -311,11 +287,9 @@ en: sharing: people_sharing: "People sharing with you:" index: - add_to_aspect: "Add contacts to %{name}" start_a_conversation: "Start a conversation" add_a_new_aspect: "Add a new aspect" title: "Contacts" - your_contacts: "Your contacts" no_contacts: "Looks like you need to add some contacts!" no_contacts_message: "Check out %{community_spotlight}" community_spotlight: "Community spotlight" @@ -334,12 +308,9 @@ en: index: conversations_inbox: "Conversations – Inbox" new_conversation: "New conversation" - no_conversation_selected: "No conversation selected" create_a_new_conversation: "Start a new conversation" no_messages: "No messages" inbox: "Inbox" - conversation: - participants: "Participants" show: reply: "Reply" replying: "Replying..." @@ -353,12 +324,6 @@ en: message: "Message" send: "Send" sending: "Sending..." - abandon_changes: "Abandon changes?" - helper: - new_messages: - zero: "No new messages" - one: "1 new messages" - other: "%{count} new messages" create: sent: "Message sent" fail: "Invalid message" @@ -624,25 +589,19 @@ en: report_bugs: "report them" invitation_codes: - excited: "%{name} is excited to see you here." not_valid: "That invite code is no longer valid" - + invitations: create: sent: "Invitations have been sent to: %{emails}" rejected: "The following email addresses had problems: " no_more: "You have no more invitations." - already_sent: "You already invited this person." - already_contacts: "You are already connected with this person" - own_address: "You can’t send an invitation to your own address." empty: "Please enter at least one email address." note_already_sent: "Invitations have already been sent to: %{emails}" new: language: "Language" invite_someone_to_join: "Invite someone to join diaspora*!" - if_they_accept_info: "if they accept, they will be added to the aspect you invited them." comma_separated_plz: "You can enter multiple email addresses separated by commas." - check_out_diaspora: "Hey! You should check out diaspora*" to: "To" personal_message: "Personal message" send_an_invitation: "Send an invitation" @@ -653,15 +612,8 @@ en: zero: "No invites left on this code" one: "One invite left on this code" other: "%{count} invites left on this code" - aspect: "Aspect" - already_invited: "The following people have not accepted your invitation:" - resend: "Resend" - check_out_diaspora: "Check out diaspora*!" check_token: not_found: "Invitation token not found" - edit: - your_account_awaits: "Your account awaits!" - accept_your_invitation: "Accept your invitation" a_facebook_user: "A Facebook user" layouts: @@ -670,7 +622,6 @@ en: settings: "Settings" help: "Help" logout: "Log out" - blog: "Blog" login: "Log in" code: "Code" admin: "Admin" @@ -693,14 +644,6 @@ en: zero: "No likes" one: "%{count} like" other: "%{count} likes" - people_like_this_comment: - zero: "No likes" - one: "%{count} like" - other: "%{count} likes" - people_dislike_this: - zero: "No dislikes" - one: "%{count} dislike" - other: "%{count} dislikes" notifications: started_sharing: @@ -722,7 +665,7 @@ en: mentioned: zero: "%{actors} have mentioned you in the post %{post_link}." one: "%{actors} has mentioned you in the post %{post_link}." - other: "%{actors} have mentioned you in the %{post_link}." + other: "%{actors} have mentioned you in the post %{post_link}." liked: zero: "%{actors} have liked your post %{post_link}." one: "%{actors} has liked your post %{post_link}." @@ -942,9 +885,24 @@ en: openid: name: "basic profile" description: "This allows the application to read your basic profile" - extended: + sub: + name: "sub" + description: "This grants sub permissions to the application" + aud: + name: "aud" + description: "This grants aud permissions to the application" + name: + name: "name" + description: "This grants name permissions to the application" + nickname: + name: "nickname" + description: "This grants nickname permissions to the application" + profile: name: "extended profile" description: "This allows the application to read your extended profile" + picture: + name: "picture" + description: "This grants picture permissions to the application" read: name: "read profile, stream and conversations" description: "This allows the application to read your stream, your conversations and your complete profile" @@ -962,10 +920,7 @@ en: one: "1 person" other: "%{count} people" person: - pending_request: "Pending request" - already_connected: "Already connected" thats_you: "That’s you!" - add_contact: "Add contact" index: results_for: "Users matching %{search_term}" no_results: "Hey! You need to search for something." @@ -979,54 +934,23 @@ en: fail: "Sorry, we couldn’t find %{handle}." show: has_not_shared_with_you_yet: "%{name} has not shared any posts with you yet!" - incoming_request: "%{name} wants to share with you" return_to_aspects: "Return to your aspects page" to_accept_or_ignore: "to accept or ignore it." does_not_exist: "Person does not exist!" - not_connected: "You are not sharing with this person" - recent_posts: "Recent posts" - recent_public_posts: "Recent public posts" - see_all: "See all" - start_sharing: "Start sharing" message: "Message" mention: "Mention" closed_account: "This account has been closed." - sub_header: - you_have_no_tags: "You have no tags!" - add_some: "Add some" - edit: "Edit" profile_sidebar: - remove_contact: "Remove contact" - edit_my_profile: "Edit my profile" bio: "Bio" location: "Location" gender: "Gender" born: "Birthday" - photos: "Photos" - in_aspects: "In aspects" - remove_from: "Remove %{name} from %{aspect}?" - helper: - results_for: " results for %{params}" - is_sharing: "%{name} is sharing with you" - is_not_sharing: "%{name} is not sharing with you" - aspect_list: - edit_membership: "Edit aspect membership" - add_contact_small: - add_contact_from_tag: "Add contact from tag" add_contact: invited_by: "You were invited by" photos: show: - delete_photo: "Delete photo" - make_profile_photo: "Make profile photo" - update_photo: "Update photo" - edit: "Edit" - edit_delete_photo: "Edit photo description / delete photo" - collection_permalink: "Collection permalink" show_original_post: "Show original post" - edit: - editing: "Editing" photo: view_all: "View all of %{name}’s photos" new: @@ -1037,9 +961,6 @@ en: runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" integrity_error: "Photo upload failed. Are you sure that was an image?" type_error: "Photo upload failed. Are you sure an image was added?" - update: - notice: "Photo successfully updated." - error: "Failed to edit photo." destroy: notice: "Photo deleted." new_photo: @@ -1048,8 +969,6 @@ en: empty: "{file} is empty, please select files again without it." new_profile_photo: upload: "Upload a new profile photo!" - or_select_one_existing: "or select one from your already existing %{photos}" - comment_email_subject: "%{name}’s photo" polls: votes: @@ -1089,11 +1008,6 @@ en: created: "A report was created" failed: "Something went wrong" - share_visibilites: - update: - post_hidden_and_muted: "%{name}’s post has been hidden, and notifications have been muted." - see_it_on_their_profile: "If you want to see updates on this post, visit %{name}’s profile page." - profiles: edit: basic: "My basic profile" @@ -1128,11 +1042,6 @@ en: registrations: new: - create_my_account: "Create my account!" - - join_the_movement: "Join the movement!" - sign_up_message: "Social networking with a ♥" - enter_email: "Enter your email address" enter_username: "Pick a username (only letters, numbers, and underscores)" enter_password: "Enter a password (six character minimum)" @@ -1147,43 +1056,16 @@ en: terms_link: "terms of service" create: success: "You’ve joined diaspora*!" - edit: - edit: "Edit %{name}" - leave_blank: "(leave blank if you don’t want to change it)" - password_to_confirm: "(we need your current password to confirm your changes)" - unhappy: "Unhappy?" - update: "Update" - cancel_my_account: "Cancel my account" closed: "Signups are closed on this diaspora* pod." invalid_invite: "The invite link you provided is no longer valid!" - requests: - manage_aspect_contacts: - manage_within: "Manage contacts within" - existing: "Existing contacts" - destroy: - success: "You are now sharing." - error: "Please select an aspect!" - ignore: "Ignored contact request." - create: - sending: "Sending" - sent: "You’ve asked to share with %{name}. They should see it next time they log in to diaspora*." - new_request_to_person: - sent: "Sent!" - helper: - new_requests: - zero: "No new requests" - one: "New request!" - other: "%{count} new requests!" reshares: reshare: reshared_via: "Reshared via" - reshare_original: "Reshare original" reshare: zero: "Reshare" one: "1 reshare" other: "%{count} reshares" - show_original: "Show original" reshare_confirmation: "Reshare %{author}’s post?" deleted: "Original post deleted by author." create: @@ -1215,25 +1097,14 @@ en: success: "Successfully deleted authentication." failure: error: "There was an error connecting to that service" - inviter: - join_me_on_diaspora: "Join me on diaspora*" - click_link_to_accept_invitation: "Follow this link to accept your invitation" - finder: - fetching_contacts: "diaspora* is populating your %{service} friends, please check back in a few minutes." - service_friends: "%{service} friends" - no_friends: "No Facebook friends found." - remote_friend: - resend: "Resend" - invite: "Invite" - not_on_diaspora: "Not yet on diaspora*" blocks: create: success: "All right, you won’t see that user in your stream again. #silencio!" - failure: "I couldn’t ignore that user. #evasion" + failure: "I couldn’t ignore that user. #evasion" destroy: success: "Let’s see what they have to say! #sayhello" - failure: "I couldn’t stop ignoring that user. #evasion" + failure: "I couldn’t stop ignoring that user. #evasion" shared: aspect_dropdown: @@ -1249,16 +1120,12 @@ en: posting: "Posting..." share: "Share" preview: "Preview" - post_a_message_to: "Post a message to %{aspect}" - make_public: "Make public" all: "All" upload_photos: "Upload photos" get_location: "Get your location" remove_location: "Remove location" all_contacts: "All contacts" - share_with: "Share with" whats_on_your_mind: "What’s on your mind?" - publishing_to: "Publishing to: " discard_post: "Discard post" new_user_prefill: newhere: "newhere" @@ -1271,21 +1138,10 @@ en: add_a_poll: "Add a poll" question: "Question" option: "Option 1" - add_contact: - enter_a_diaspora_username: "Enter a diaspora* username:" - your_diaspora_username_is: "Your diaspora* username is: %{diaspora_handle}" - create_request: "Find by diaspora* ID" - diaspora_handle: "diaspora@pod.org" - know_email: "Know their email address? You should invite them" - add_new_contact: "Add a new contact" invitations: invites: "Invites" - invite_someone: "Invite someone" invitations_left: "%{count} left" - dont_have_now: "You don’t have any right now, but more invites are coming soon!" - invites_closed: "Invites are currently closed on this diaspora* pod" invite_your_friends: "Invite your friends" - from_facebook: "From Facebook" by_email: "By email" share_this: "Share this link via email, blog, or social networks!" reshare: @@ -1300,14 +1156,7 @@ en: logged_in: "Logged in to %{service}" manage: "Manage connected services" atom_feed: "Atom feed" - notification: - new: "New %{type} from %{from}" - contact_list: - all_contacts: "All contacts" stream_element: - viewable_to_anyone: "This post is viewable to anyone on the web" - connect_to_comment: "Connect to this user to comment on their post" - currently_unavailable: "Commenting currently unavailable" via: "Via %{link}" via_mobile: "Via mobile" ignore_user: "Ignore %{name}" @@ -1315,20 +1164,12 @@ en: hide_and_mute: "Hide and mute post" like: "Like" unlike: "Unlike" - dislike: "Dislike" - shared_with: "Shared with: %{aspect_names}" - nsfw: "This post has been flagged as NSFW by its author. %{link}" show: "Show" - footer: - logged_in_as: "Logged in as %{name}" - your_aspects: "Your aspects" status_messages: new: mentioning: "Mentioning: %{person}" create: success: "Successfully mentioned: %{names}" - helper: - no_message_to_display: "No message to display." destroy: failure: "Failed to delete post" too_long: "Please make your status message fewer than %{count} characters. Right now it is %{current_length} characters" @@ -1453,7 +1294,6 @@ en: locked_out: "You will get signed out and locked out of your account until it has been deleted." lock_username: "Your username will be locked. You will not be able to create a new account on this pod with the same ID." no_turning_back: "There is no turning back! If you’re really sure, enter your password below." - if_you_want_this: "If you really want this to happen, type in your password below and click “Close account”" privacy_settings: title: "Privacy settings" @@ -1477,7 +1317,6 @@ en: what_are_you_in_to: "What are you into?" hashtag_explanation: "Hashtags allow you to talk about and follow your interests. They’re also a great way to find new people on diaspora*." hashtag_suggestions: "Try following tags like #art, #movies, #gif, etc." - saved: "Saved!" update: password_changed: "Password changed. You can now log in with your new password." @@ -1506,13 +1345,6 @@ en: previous_label: "« previous" next_label: "next »" - webfinger: - fetch_failed: "Failed to fetch webfinger profile for %{profile_url}" - hcard_fetch_failed: "There was a problem fetching the hcard for %{account}" - xrd_fetch_failed: "There was an error getting the xrd from account %{account}" - not_enabled: "Webfinger does not seem to be enabled for %{account}’s host" - no_person_constructed: "No person could be constructed from this hcard." - simple_captcha: placeholder: "Enter the image value" label: "Enter the code in the box:" diff --git a/config/locales/javascript/javascript.en.yml b/config/locales/javascript/javascript.en.yml index b9b5dc3d4..370e45480 100644 --- a/config/locales/javascript/javascript.en.yml +++ b/config/locales/javascript/javascript.en.yml @@ -92,6 +92,7 @@ en: prefixFromNow: "" suffixAgo: "ago" suffixFromNow: "from now" + inPast: "any moment now" seconds: "less than a minute" minute: "about a minute" minutes: "%d minutes" @@ -107,6 +108,8 @@ en: contacts: add_contact: "Add contact" + aspect_chat_is_enabled: "Contacts in this aspect are able to chat with you." + aspect_chat_is_not_enabled: "Contacts in this aspect are not able to chat with you." aspect_list_is_visible: "Contacts in this aspect are able to see each other." aspect_list_is_not_visible: "Contacts in this aspect are not able to see each other." remove_contact: "Remove contact" @@ -118,12 +121,7 @@ en: my_stream: "Stream" my_aspects: "My aspects" - videos: - watch: "Watch this video on <%= provider %>" - unknown: "Unknown video type" - search_for: "Search for <%= name %>" publisher: - at_least_one_aspect: "You must publish to at least one aspect" limited: "Limited: your post will only be seen by people you are sharing with" public: "Public: your post will be visible to everyone and found by search engines" near_from: "Posted from: <%= location %>" @@ -134,9 +132,6 @@ en: post_something: "Post to diaspora*" post_submit: "Submitting post..." post_success: "Posted! Closing popup window..." - infinite_scroll: - no_more: "No more posts." - no_more_contacts: "No more contacts." aspect_dropdown: add_to_aspect: "Add contact" select_aspects: "Select aspects" @@ -207,7 +202,6 @@ en: posts: "Posts" conversation: - participants: "Participants" new: no_contacts: "You need to add some contacts before you can start a conversation." @@ -261,7 +255,7 @@ en: stop_following_confirm: "Stop following #<%= tag %>?" follow_error: "Couldn’t follow #<%= tag %> :(" stop_following_error: "Couldn’t stop following #<%= tag %> :(" - + reactions: zero: "<%= count%> reactions" one: "<%= count%> reaction" @@ -290,14 +284,7 @@ en: close: "Close" viewer: - stop_following_post: "Stop following post" - follow_post: "Follow post" - like: "Like" - unlike: "Unlike" - reshare: "Reshare" reshared: "Reshared" - comment: "Comment" - home: "Home" poll: vote: "Vote" diff --git a/spec/helpers/language_helper_spec.rb b/spec/helpers/language_helper_spec.rb new file mode 100644 index 000000000..73d4df5f8 --- /dev/null +++ b/spec/helpers/language_helper_spec.rb @@ -0,0 +1,10 @@ +require "spec_helper" + +describe LanguageHelper, type: :helper do + describe "#get_javascript_strings_for" do + it "generates a jasmine fixture", fixture: true do + save_fixture(get_javascript_strings_for("en", "javascripts").to_json, "locale_en_javascripts_json") + save_fixture(get_javascript_strings_for("en", "help").to_json, "locale_en_help_json") + end + end +end diff --git a/spec/javascripts/app/collections/aspects_spec.js b/spec/javascripts/app/collections/aspects_spec.js index ab89a4206..cb06018a6 100644 --- a/spec/javascripts/app/collections/aspects_spec.js +++ b/spec/javascripts/app/collections/aspects_spec.js @@ -1,17 +1,10 @@ describe("app.collections.Aspects", function(){ beforeEach(function(){ - var locale = { - and: 'and', - comma: ',', - my_aspects: 'My Aspects' - }; var my_aspects = [ { name: 'Work', selected: true }, { name: 'Friends', selected: false }, { name: 'Acquaintances', selected: false } ]; - - Diaspora.I18n.load(locale); this.aspects = new app.collections.Aspects(my_aspects); }); @@ -52,7 +45,7 @@ describe("app.collections.Aspects", function(){ }); it("returns the name of the aspect", function(){ - expect(this.aspects.toSentence()).toEqual('My Aspects'); + expect(this.aspects.toSentence()).toEqual("My aspects"); }); }); diff --git a/spec/javascripts/app/helpers/handlebars-helpers_spec.js b/spec/javascripts/app/helpers/handlebars-helpers_spec.js index 1ea73894f..9ff382cf4 100644 --- a/spec/javascripts/app/helpers/handlebars-helpers_spec.js +++ b/spec/javascripts/app/helpers/handlebars-helpers_spec.js @@ -1,8 +1,4 @@ describe("Handlebars helpers", function() { - beforeEach(function() { - Diaspora.I18n.load({people: {helper: {"is_not_sharing": "<%= name %> is not sharing with you"}}}); - }); - describe("sharingMessage", function() { it("escapes the person's name", function() { var person = { name: "\"> \">"}; diff --git a/spec/javascripts/app/pages/admin_dashboard_spec.js b/spec/javascripts/app/pages/admin_dashboard_spec.js index 0daba931d..3b97a3fab 100644 --- a/spec/javascripts/app/pages/admin_dashboard_spec.js +++ b/spec/javascripts/app/pages/admin_dashboard_spec.js @@ -3,19 +3,6 @@ describe("app.pages.AdminDashboard", function(){ spec.loadFixture("admin_dashboard"); this.view = new app.pages.AdminDashboard(); gon.podVersion = "0.5.1.2"; - // disable jshint camelcase for i18n - /* jshint camelcase: false */ - Diaspora.I18n.load({ - admins: { - dashboard: { - up_to_date: "Your pod is up to date!", - outdated: "Your pod is outdated.", - compare_versions: "Latest d* release is <%= latestVersion%>, your pod is running <%= podVersion %>.", - error: "Unable to determine latest diaspora* version." - } - } - }); - /* jshint camelcase: true */ }); describe("initialize" , function() { diff --git a/spec/javascripts/app/pages/contacts_spec.js b/spec/javascripts/app/pages/contacts_spec.js index 84010b3bb..961378a5c 100644 --- a/spec/javascripts/app/pages/contacts_spec.js +++ b/spec/javascripts/app/pages/contacts_spec.js @@ -9,14 +9,6 @@ describe("app.pages.Contacts", function(){ collection: app.contacts } }); - Diaspora.I18n.load({ - contacts: { - aspect_list_is_visible: "Contacts in this aspect are able to see each other.", - aspect_list_is_not_visible: "Contacts in this aspect are not able to see each other.", - aspect_chat_is_enabled: "Contacts in this aspect are able to chat with you.", - aspect_chat_is_not_enabled: "Contacts in this aspect are not able to chat with you.", - } - }); }); context('toggle chat privilege', function() { diff --git a/spec/javascripts/app/views/aspect_create_view_spec.js b/spec/javascripts/app/views/aspect_create_view_spec.js index 780a5c9cd..8f3efea36 100644 --- a/spec/javascripts/app/views/aspect_create_view_spec.js +++ b/spec/javascripts/app/views/aspect_create_view_spec.js @@ -1,20 +1,6 @@ describe("app.views.AspectCreate", function() { beforeEach(function() { app.events.off("aspect:create"); - // disable jshint camelcase for i18n - /* jshint camelcase: false */ - Diaspora.I18n.load({ - aspects: { - make_aspect_list_visible: "Make contacts in this aspect visible to each other?", - name: "Name", - create: { - add_a_new_aspect: "Add a new aspect", - success: "Your new aspect <%= name %> was created", - failure: "Aspect creation failed." - } - } - }); - /* jshint camelcase: true */ }); context("without a person id", function() { diff --git a/spec/javascripts/app/views/aspect_membership_view_spec.js b/spec/javascripts/app/views/aspect_membership_view_spec.js index 536834a9e..3222d1ec1 100644 --- a/spec/javascripts/app/views/aspect_membership_view_spec.js +++ b/spec/javascripts/app/views/aspect_membership_view_spec.js @@ -10,14 +10,6 @@ describe("app.views.AspectMembership", function(){ app.flashMessages = new app.views.FlashMessages({ el: this.view.$("#flash-container") }); this.personId = $(".dropdown-menu").data("person_id"); this.personName = $(".dropdown-menu").data("person-short-name"); - Diaspora.I18n.load({ - aspect_dropdown: { - started_sharing_with: 'you started sharing with <%= name %>', - stopped_sharing_with: 'you stopped sharing with <%= name %>', - error: 'unable to add <%= name %>', - error_remove: 'unable to remove <%= name %>' - } - }); }); context('adding to aspects', function() { diff --git a/spec/javascripts/app/views/aspects_dropdown_view_spec.js b/spec/javascripts/app/views/aspects_dropdown_view_spec.js index 9e637b390..004706b1d 100644 --- a/spec/javascripts/app/views/aspects_dropdown_view_spec.js +++ b/spec/javascripts/app/views/aspects_dropdown_view_spec.js @@ -1,15 +1,6 @@ describe("app.views.AspectsDropdown", function(){ beforeEach(function() { spec.loadFixture("bookmarklet"); - Diaspora.I18n.reset({ - 'aspect_dropdown': { - 'select_aspects': "Select aspects", - 'all_aspects': "All aspects", - 'toggle': { - 'zero': "Select aspects", - 'one': "In <%= count %> aspect", - 'other': "In <%= count %> aspects" - }}}); this.view = new app.views.AspectsDropdown({el: $('.aspect_dropdown')}); }); diff --git a/spec/javascripts/app/views/aspects_list_view_spec.js b/spec/javascripts/app/views/aspects_list_view_spec.js index 25e87b0ec..165ee7bc7 100644 --- a/spec/javascripts/app/views/aspects_list_view_spec.js +++ b/spec/javascripts/app/views/aspects_list_view_spec.js @@ -1,11 +1,6 @@ describe("app.views.AspectsList", function(){ beforeEach(function(){ setFixtures(''); - Diaspora.I18n.load({ aspect_navigation : { - 'select_all' : 'Select all', - 'deselect_all' : 'Deselect all' - }}); - var aspects = [{ name: 'Work', selected: true }, { name: 'Friends', selected: false }, { name: 'Acquaintances', selected: false }]; diff --git a/spec/javascripts/app/views/comment_stream_view_spec.js b/spec/javascripts/app/views/comment_stream_view_spec.js index e45f82033..9157aab5f 100644 --- a/spec/javascripts/app/views/comment_stream_view_spec.js +++ b/spec/javascripts/app/views/comment_stream_view_spec.js @@ -50,14 +50,12 @@ describe("app.views.CommentStream", function(){ }); it("doesn't add the comment to the view, when the request fails", function(){ - // disable jshint camelcase for i18n - /* jshint camelcase: false */ - Diaspora.I18n.load({failed_to_comment: "posting failed!"}); - /* jshint camelcase: true */ this.request.respondWith({status: 500}); expect(this.view.$(".comment-content p").text()).not.toEqual("a new comment"); - expect(this.view.$(".flash-message")).toBeErrorFlashMessage("posting failed!"); + expect(this.view.$(".flash-message")).toBeErrorFlashMessage( + "Failed to comment. Maybe the author is ignoring you?" + ); }); }); diff --git a/spec/javascripts/app/views/contact_view_spec.js b/spec/javascripts/app/views/contact_view_spec.js index 57acbd406..f5f8ba1c5 100644 --- a/spec/javascripts/app/views/contact_view_spec.js +++ b/spec/javascripts/app/views/contact_view_spec.js @@ -9,14 +9,6 @@ describe("app.views.Contact", function(){ aspect_memberships: [{id: 23, aspect: this.aspect1}] }); this.view = new app.views.Contact({ model: this.model }); - Diaspora.I18n.load({ - contacts: { - add_contact: "Add contact", - remove_contact: "Remove contact", - error_add: "Couldn't add <%= name %> to the aspect :(", - error_remove: "Couldn't remove <%= name %> from the aspect :(" - } - }); }); context("#presenter", function() { diff --git a/spec/javascripts/app/views/feedback_view_spec.js b/spec/javascripts/app/views/feedback_view_spec.js index 18f093fe6..fa69641e0 100644 --- a/spec/javascripts/app/views/feedback_view_spec.js +++ b/spec/javascripts/app/views/feedback_view_spec.js @@ -2,14 +2,6 @@ describe("app.views.Feedback", function(){ beforeEach(function(){ this.userAttrs = _.extend(factory.userAttrs(), {guid : -1}); loginAs(this.userAttrs); - - Diaspora.I18n.load({stream : { - 'like' : "Like", - 'unlike' : "Unlike", - 'public' : "Public", - 'limited' : "Limted" - }}); - var posts = $.parseJSON(spec.readFixture("stream_json")); this.post = new app.models.Post(posts[0]); diff --git a/spec/javascripts/app/views/help_view_spec.js b/spec/javascripts/app/views/help_view_spec.js index 3c400d678..098e7dfcc 100644 --- a/spec/javascripts/app/views/help_view_spec.js +++ b/spec/javascripts/app/views/help_view_spec.js @@ -1,8 +1,9 @@ describe("app.views.Help", function(){ beforeEach(function(){ gon.appConfig = {chat: {enabled: false}}; + this.locale = JSON.parse(spec.readFixture("locale_en_help_json")); + Diaspora.I18n.load(this.locale, "en"); this.view = new app.views.Help(); - Diaspora.I18n.load({"tutorials":"tutorials","tutorial":"tutorial","irc":"IRC","wiki":"wiki","markdown":"Markdown","here":"here","foundation_website":"diaspora foundation website","third_party_tools":"third party tools","getting_started_tutorial":"'Getting started' tutorial series","getting_help":{"title":"Getting help","getting_started_q":"Help! I need some basic help to get me started!","getting_started_a":"You're in luck. Try the %{tutorial_series} on our project site. It will take you step-by-step through the registration process and teach you all the basic things you need to know about using diaspora*.","get_support_q":"What if my question is not answered in this FAQ? Where else can I get support?","get_support_a_website":"visit our %{link}","get_support_a_tutorials":"check out our %{tutorials}","get_support_a_wiki":"search the %{link}","get_support_a_irc":"join us on %{irc} (Live chat)","get_support_a_hashtag":"ask in a public post on diaspora* using the %{question} hashtag"},"account_and_data_management":{"title":"Account and data management","move_pods_q":"How do I move my seed (account) from one pod to another?","move_pods_a":"In the future you will be able to export your seed from a pod and import it on another, but this is not currently possible. You could always open a new account and add your contacts to aspects on that new seed, and ask them to add your new seed to their aspects.","download_data_q":"Can I download a copy of all of my data contained in my seed (account)?","download_data_a":"Yes. At the bottom of the Account tab of your settings page there are two buttons for downloading your data.","close_account_q":"How do I delete my seed (account)?","close_account_a":"Go to the bottom of your settings page and click the Close Account button.","data_visible_to_podmin_q":"How much of my information can my pod administrator see?","data_visible_to_podmin_a":"Communication *between* pods is always encrypted (using SSL and diaspora*'s own transport encryption), but the storage of data on pods is not encrypted. If they wanted to, the database administrator for your pod (usually the person running the pod) could access all your profile data and everything that you post (as is the case for most websites that store user data). Running your own pod provides more privacy since you then control access to the database.","data_other_podmins_q":"Can the administrators of other pods see my information?","data_other_podmins_a":"Once you are sharing with someone on another pod, any posts you share with them and a copy of your profile data are stored (cached) on their pod, and are accessible to that pod's database administrator. When you delete a post or profile data it is deleted from your pod and any other pods where it had previously been stored."},"aspects":{"title":"Aspects","what_is_an_aspect_q":"What is an aspect?","what_is_an_aspect_a":"Aspects are the way you group your contacts on diaspora*. An aspect is one of the faces you show to the world. It might be who you are at work, or who you are to your family, or who you are to your friends in a club you belong to.","who_sees_post_q":"When I post to an aspect, who sees it?","who_sees_post_a":"If you make a limited post, it will only be visible the people you have put in that aspect (or those aspects, if it is made to multiple aspects). Contacts you have that aren't in the aspect have no way of seeing the post, unless you've made it public. Only public posts will ever be visible to anyone who you haven't placed into one of your aspects.","restrict_posts_i_see_q":"Can I restrict the posts I see to just those from certain aspects?","restrict_posts_i_see_a":"Yes. Click on My Aspects in the side-bar and then click individual aspects in the list to select or deselect them. Only the posts by people in the selected aspects will appear in your stream.","contacts_know_aspect_q":"Do my contacts know which aspects I have put them in?","contacts_know_aspect_a":"No. They cannot see the name of the aspect under any circumstances.","contacts_visible_q":"What does \"make contacts in this aspect visible to each other\" mean?","contacts_visible_a":"If you check this option then contacts from that aspect will be able to see who else is in it, on your profile page under your picture. It's best to select this option only if the contacts in that aspect all know each other. They still won't be able to see what the aspect is called.","remove_notification_q":"If I remove someone from an aspect, or all of my aspects, are they notified of this?","remove_notification_a":"No.","rename_aspect_q":"Can I rename an aspect?","rename_aspect_a":"Yes. In your list of aspects on the left side of the main page, point your mouse at the aspect you want to rename. Click the little 'edit' pencil that appears to the right. Click rename in the box that appears.","change_aspect_of_post_q":"Once I have posted something, can I change the aspect(s) that can see it?","change_aspect_of_post_a":"No, but you can always make a new post with the same content and post it to a different aspect.","post_multiple_aspects_q":"Can I post content to multiple aspects at once?","post_multiple_aspects_a":"Yes. When you are making a post, use the aspect selector button to select or deselect aspects. Your post will be visible to all the aspects you select. You could also select the aspects you want to post to in the side-bar. When you post, the aspect(s) that you have selected in the list on the left will automatically be selected in the aspect selector when you start to make a new post.","person_multiple_aspects_q":"Can I add a person to multiple aspects?","person_multiple_aspects_a":"Yes. Go to your contacts page and click my contacts. For each contact you can use the menu on the right to add them to (or remove them from) as many aspects as you want. Or you can add them to a new aspect (or remove them from an aspect) by clicking the aspect selector button on their profile page. Or you can even just move the pointer over their name where you see it in the stream, and a 'hover-card' will appear. You can change the aspects they are in right there.","delete_aspect_q":"How do I delete an aspect?","delete_aspect_a":"In your list of aspects on the left side of the main page, point your mouse at the aspect you want to delete. Click the little 'edit' pencil that appears on the right. Click the delete button in the box that appears."},"mentions":{"title":"Mentions","what_is_a_mention_q":"What is a \"mention\"?","what_is_a_mention_a":"A mention is a link to a person's profile page that appears in a post. When someone is mentioned they receive a notification that calls their attention to the post.","how_to_mention_q":"How do I mention someone when making a post?","how_to_mention_a":"Type the \"@\" sign and start typing their name. A drop down menu should appear to let you select them more easily. Note that it is only possible to mention people you have added to an aspect.","mention_in_comment_q":"Can I mention someone in a comment?","mention_in_comment_a":"No, not currently.","see_mentions_q":"Is there a way to see the posts in which I have been mentioned?","see_mentions_a":"Yes, click \"Mentions\" in the left hand column on your home page."},"pods":{"title":"Pods","what_is_a_pod_q":"What is a pod?","what_is_a_pod_a":"A pod is a server running the diaspora* software and connected to the diaspora* network. \"Pod\" is a metaphor referring to pods on plants which contain seeds, in the way that a server contains a number of user accounts. There are many different pods. You can add friends from other pods and communicate with them. (You can think of a diaspora* pod as similar to an email provider: there are public pods, private pods, and with some effort you can even run your own).","find_people_q":"I just joined a pod, how can I find people to share with?","find_people_a":"Invite your friends using the email link in the side-bar. Follow #tags to discover others who share your interests, and add those who post things that interest you to an aspect. Shout out that you're #newhere in a public post.","use_search_box_q":"How do I use the search box to find particular individuals?","use_search_box_a":"If you know their full diaspora* ID (e.g. username@podname.org), you can find them by searching for it. If you are on the same pod you can search for just their username. An alternative is to search for them by their profile name (the name you see on screen). If a search does not work the first time, try it again."},"posts_and_posting":{"title":"Posts and posting","hide_posts_q":"How do I hide a post? / How do I stop getting notifications about a post that I commented on?","hide_posts_a":"If you point your mouse at the top of a post, an X appears on the right. Click it to hide the post and mute notifications about it. You can still see the post if you visit the profile page of the person who posted it.","format_text_q":"How can I format the text in my posts (bold, italics, etc.)?","format_text_a":"By using a simplified system called %{markdown}. You can find the full Markdown syntax %{here}. The preview button is really helpful here, as you can see how your message will look before you share it.","insert_images_q":"How do I insert images into posts?","insert_images_a":"Click the little camera icon to insert an image into a post. Press the photo icon again to add another photo, or you can select multiple photos to upload in one go.","insert_images_comments_q":"Can I insert images into comments?","insert_images_comments_a1":"The following Markdown code","image_text":"image text","image_url":"image url","insert_images_comments_a2":"can be used to insert images from the web into comments as well as posts.","size_of_images_q":"Can I customize the size of images in posts or comments?","size_of_images_a":"No. Images are resized automatically to fit the stream. Markdown does not have a code for specifying the size of an image.","embed_multimedia_q":"How do I embed a video, audio, or other multimedia content into a post?","embed_multimedia_a":"You can usually just paste the URL (e.g. http://www.youtube.com/watch?v=nnnnnnnnnnn ) into your post and the video or audio will be embedded automatically. Some of the sites that are supported are: YouTube, Vimeo, SoundCloud, Flickr and a few more. diaspora* uses oEmbed for this feature. We're supporting new sites all the time. Remember to always post simple, full links: no shortened links; no operators after the base URL; and give it a little time before you refresh the page after posting for seeing the preview.","character_limit_q":"What is the character limit for posts?","character_limit_a":"65,535 characters. That's 65,395 more characters than you get on Twitter! ;)","char_limit_services_q":"What is the character limit for posts shared through a connected service with a smaller character count?","char_limit_services_a":"In that case your post is limited to the smaller character count (140 in the case of Twitter; 1000 in the case of Tumblr), and the number of characters you have left to use is displayed when that service's icon is highlighted. You can still post to these services if your post is longer than their limit, but the text is truncated on those services.","stream_full_of_posts_q":"Why is my stream full of posts from people I don't know and don't share with?","stream_full_of_posts_a1":"Your stream is made up of three types of posts:","stream_full_of_posts_li1":"Posts by people you are sharing with, which come in two types: public posts and limited posts shared with an aspect that you are part of. To remove these posts from your stream, simply stop sharing with the person.","stream_full_of_posts_li2":"Public posts containing one of the tags that you follow. To remove these, stop following the tag.","stream_full_of_posts_li3":"Public posts by people listed in the Community Spotlight. These can be removed by unchecking the “Show Community Spotlight in Stream?” option in the Account tab of your Settings."},"private_posts":{"title":"Private posts","who_sees_post_q":"When I post a message to an aspect (i.e., a private post), who can see it?","who_sees_post_a":"Only logged-in diaspora* users you have placed in that aspect can see your private post.","can_comment_q":"Who can comment on or like my private post?","can_comment_a":"Only logged-in diaspora* users you have placed in that aspect can comment on or like your private post.","can_reshare_q":"Who can reshare my private post?","can_reshare_a":"Nobody. Private posts are not resharable. Logged-in diaspora* users in that aspect can potentially copy and paste it, however.","see_comment_q":"When I comment on or like a private post, who can see it?","see_comment_a":"Only the people that the post was shared with (the people who are in the aspects selected by the original poster) can see its comments and likes. "},"private_profiles":{"title":"Private profiles","who_sees_profile_q":"Who sees my private profile?","who_sees_profile_a":"Any logged-in user that you are sharing with (meaning, you have added them to one of your aspects). However, people following you, but whom you do not follow, will see only your public information.","whats_in_profile_q":"What's in my private profile?","whats_in_profile_a":"Biography, location, gender, and birthday. It's the stuff in the bottom section of the edit profile page. All this information is optional – it's up to you whether you fill it in. Logged-in users who you have added to your aspects are the only people who can see your private profile. They will also see the private posts that made to the aspect(s) they are in, mixed in with your public posts, when they visit your profile page.","who_sees_updates_q":"Who sees updates to my private profile?","who_sees_updates_a":"Anyone in your aspects sees changes to your private profile. "},"public_posts":{"title":"Public posts","who_sees_post_q":"When I post something publicly, who can see it?","who_sees_post_a":"Anyone using the internet can potentially see a post you mark public, so make sure you really do want your post to be public. It's a great way of reaching out to the world.","find_public_post_q":"How can other people find my public post?","find_public_post_a":"Your public posts will appear in the streams of anyone following you. If you included #tags in your public post, anyone following those tags will find your post in their streams. Every public post also has a specific URL that anyone can view, even if they're not logged in - thus public posts may be linked to directly from Twitter, blogs, etc. Public posts may also be indexed by search engines.","can_comment_reshare_like_q":"Who can comment on, reshare, or like my public post?","can_comment_reshare_like_a":"Any logged-in diaspora* user can comment on, reshare, or like your public post.","see_comment_reshare_like_q":"When I comment on, reshare, or like a public post, who can see it?","see_comment_reshare_like_a":"Any logged-in diaspora* user and anyone else on the internet. Comments, likes, and reshares of public posts are also public.","deselect_aspect_posting_q":"What happens when I deselect one or more aspects when making a public post?","deselect_aspect_posting_a":"Deselecting aspects does not affect a public post. It will still appear in the streams of all of your contacts. To make a post visible only to specific aspects, you need to select those aspects from the button under the publisher."},"public_profiles":{"title":"Public profiles","who_sees_profile_q":"Who sees my public profile?","who_sees_profile_a":"Any logged-in diaspora* user, as well as the wider internet, can see it. Each profile has a direct URL, so it may be linked to directly from outside sites. It may be indexed by search engines.","whats_in_profile_q":"What's in my public profile","whats_in_profile_a":"Your name, the five tags you chose to describe yourself, and your photo. It's the stuff in the top section of the edit profile page. You can make this profile information as identifiable or anonymous as you like. Your profile page also shows any public posts you have made.","who_sees_updates_q":"Who sees updates to my public profile?","who_sees_updates_a":"Anyone can see changes if they visit your profile page.","what_do_tags_do_q":"What do the tags on my public profile do?","what_do_tags_do_a":"They help people get to know you. Your profile picture will also appear on the left-hand side of those particular tag pages, along with anyone else who has them in their public profile."},"resharing_posts":{"title":"Resharing posts","reshare_public_post_aspects_q":"Can I reshare a public post with only certain aspects?","reshare_public_post_aspects_a":"No, when you reshare a public post it automatically becomes one of your public posts. To share it with certain aspects, copy and paste the contents of the post into a new post.","reshare_private_post_aspects_q":"Can I reshare a private post with only certain aspects?","reshare_private_post_aspects_a":"No, it is not possible to reshare a private post. This is to respect the intentions of the original poster who only shared it with a particular group of people."},"sharing":{"title":"Sharing","add_to_aspect_q":"What happens when I add someone to one of my aspects? Or when someone adds me to one of their aspects?","add_to_aspect_a1":"Let's say that Amy adds Ben to an aspect, but Ben has not (yet) added Amy to an aspect:","add_to_aspect_li1":"Ben will receive a notification that Amy has \"started sharing\" with Ben.","add_to_aspect_li2":"Amy will start to see Ben's public posts in her stream.","add_to_aspect_li3":"Amy will not see any of Ben's private posts.","add_to_aspect_li4":"Ben will not see Amy's public or private posts in his stream.","add_to_aspect_li5":"But if Ben goes to Amy's profile page, then he will see Amy's private posts that she makes to her aspect that has him in it (as well as her public posts which anyone can see there).","add_to_aspect_li6":"Ben will be able to see Amy's private profile (bio, location, gender, birthday).","add_to_aspect_li7":"Amy will appear under \"Only sharing with me\" on Ben's contacts page.","add_to_aspect_a2":"This is known as asymmetrical sharing. If and when Ben also adds Amy to an aspect then it would become mutual sharing, with both Amy's and Ben's public posts and relevant private posts appearing in each other's streams, etc. ","only_sharing_q":"Who are the people listed in \"Only sharing with me\" on my contacts page?","only_sharing_a":"These are people that have added you to one of their aspects, but who are not (yet) in any of your aspects. In other words, they are sharing with you, but you are not sharing with them (asymmetrical sharing). If you add them to an aspect, they will then appear under that aspect and not under \"only sharing with you\". See above.","list_not_sharing_q":"Is there a list of people whom I have added to one of my aspects, but who have not added me to one of theirs?","list_not_sharing_a":"No, but you can see whether or not someone is sharing with you by visiting their profile page. If they are, the bar under their profile picture will be green; if not, it'll be grey. You should get a notification each time someone starts sharing with you.","see_old_posts_q":"When I add someone to an aspect, can they see older posts that I have already posted to that aspect?","see_old_posts_a":"No. They will only be able to see new posts to that aspect. They (and everyone else) can see your older public posts on your profile page, and they may also see them in their stream."},"tags":{"title":"Tags","what_are_tags_for_q":"What are tags for?","what_are_tags_for_a":"Tags are a way to categorize a post, usually by topic. Searching for a tag shows all posts with that tag that you can see (both public and private posts). This lets people who are interested in a given topic find public posts about it.","tags_in_comments_q":"Can I put tags in comments or just in posts?","tags_in_comments_a":"A tag added to a comment will still appear as a link to that tag's page, but it will not make that post (or comment) appear on that tag page. This only works for tags in posts.","followed_tags_q":"What are \"#Followed Tags\" and how do I follow a tag?","followed_tags_a":"After searching for a tag you can click the button at the top of the tag's page to \"follow\" that tag. It will then appear in your list of followed tags on the left. Clicking one of your followed tags takes you to that tag's page so you can see recent posts containing that tag. Click on #Followed Tags to see a stream of posts that include one of any of your followed tags. ","people_tag_page_q":"Who are the people listed on the left-hand side of a tag page?","people_tag_page_a":"They are people who have listed that tag to describe themselves in their public profile.","filter_tags_q":"How can I filter/exclude some tags from my stream?","filter_tags_a":"This is not yet available directly through diaspora*, but some %{third_party_tools} have been written that might provide this."},"miscellaneous":{"title":"Miscellaneous","back_to_top_q":"Is there a quick way to go back to the top of a page after I scroll down?","back_to_top_a":"Yes. After scrolling down a page, click on the grey arrow that appears in the bottom right corner of your browser window.","photo_albums_q":"Are there photo or video albums?","photo_albums_a":"No, not currently. However you can view a stream of their uploaded pictures from the Photos section in the side-bar of their profile page.","subscribe_feed_q":"Can I subscribe to someone's public posts with a feed reader?","subscribe_feed_a":"Yes, but this is still not a polished feature and the formatting of the results is still pretty rough. If you want to try it anyway, go to someone's profile page and click the feed button in your browser, or you can copy the profile URL (i.e. https://joindiaspora.com/people/somenumber), and paste it into a feed reader. The resulting feed address looks like this: https://joindiaspora.com/public/username.atom Diaspora uses Atom rather than RSS.","diaspora_app_q":"Is there a diaspora* app for Android or iOS?","diaspora_app_a":"There are several Android apps in very early development. Several are long-abandoned projects and so do not work well with the current version of diaspora*. Don't expect much from these apps at the moment. Currently the best way to access diaspora* from your mobile device is through a browser, because we've designed a mobile version of the site which should work well on all devices. There is currently no app for iOS. Again, diaspora* should work fine via your browser."}}, "en"); Diaspora.Page = "HelpFaq"; }); diff --git a/spec/javascripts/app/views/notifications_view_spec.js b/spec/javascripts/app/views/notifications_view_spec.js index 755679cd7..890676478 100644 --- a/spec/javascripts/app/views/notifications_view_spec.js +++ b/spec/javascripts/app/views/notifications_view_spec.js @@ -66,14 +66,14 @@ describe("app.views.Notifications", function(){ this.view.updateView(this.readN.data("guid"), this.readN.data("type"), true); expect(this.readN.hasClass("unread")).toBeTruthy(); expect(this.readN.hasClass("read")).toBeFalsy(); - expect(this.readN.find(".unread-toggle .entypo-eye").data("original-title")).toBe( + expect(this.readN.find(".unread-toggle .entypo-eye").attr("data-original-title")).toBe( Diaspora.I18n.t("notifications.mark_read") ); this.view.updateView(this.readN.data("guid"), this.readN.data("type"), false); expect(this.readN.hasClass("read")).toBeTruthy(); expect(this.readN.hasClass("unread")).toBeFalsy(); - expect(this.readN.find(".unread-toggle .entypo-eye").data("original-title")).toBe( + expect(this.readN.find(".unread-toggle .entypo-eye").attr("data-original-title")).toBe( Diaspora.I18n.t("notifications.mark_unread") ); }); diff --git a/spec/javascripts/app/views/pod_entry_view_spec.js b/spec/javascripts/app/views/pod_entry_view_spec.js index 35006f2b2..2c04effc8 100644 --- a/spec/javascripts/app/views/pod_entry_view_spec.js +++ b/spec/javascripts/app/views/pod_entry_view_spec.js @@ -1,7 +1,7 @@ describe("app.views.PodEntry", function() { beforeEach(function() { - this.pod = new app.models.Pod({id : 123}); + this.pod = factory.pod(); this.view = new app.views.PodEntry({ model: this.pod, parent: document.createDocumentFragment() diff --git a/spec/javascripts/app/views/poll_view_spec.js b/spec/javascripts/app/views/poll_view_spec.js index bbd45511d..93d685332 100644 --- a/spec/javascripts/app/views/poll_view_spec.js +++ b/spec/javascripts/app/views/poll_view_spec.js @@ -45,12 +45,6 @@ describe("app.views.Poll", function(){ describe("reshared post", function(){ beforeEach(function(){ - Diaspora.I18n.load({ - poll: { - go_to_original_post: "You can participate in this poll on the <%= original_post_link %>.", - original_post: "original post" - } - }); this.view.model.attributes.post_type = "Reshare"; this.view.model.attributes.root = {id: 1}; this.view.render(); diff --git a/spec/javascripts/app/views/publisher_view_spec.js b/spec/javascripts/app/views/publisher_view_spec.js index 1356abbc2..2b8c30c27 100644 --- a/spec/javascripts/app/views/publisher_view_spec.js +++ b/spec/javascripts/app/views/publisher_view_spec.js @@ -262,10 +262,6 @@ describe("app.views.Publisher", function() { }); describe("_beforeUnload", function(){ - beforeEach(function(){ - Diaspora.I18n.load({ confirm_unload: "Please confirm that you want to leave this page - data you have entered won't be saved."}); - }); - it("calls _submittable", function(){ spyOn(this.view, "_submittable"); $(window).trigger('beforeunload'); @@ -366,7 +362,6 @@ describe("app.views.Publisher", function() { beforeEach( function(){ loginAs({name: "alice", avatar : {small : "http://avatar.com/photo.jpg"}}); spec.loadFixture("status_message_new"); - Diaspora.I18n.load({ stream: { public: 'Public' }}); this.viewAspectSelector = new app.views.PublisherAspectSelector({ el: $(".public_toggle .aspect_dropdown"), @@ -559,7 +554,6 @@ describe("app.views.Publisher", function() { context('successful completion', function() { beforeEach(function() { - Diaspora.I18n.load({ photo_uploader: { completed: '<%= file %> completed' }}); $('#photodropzone').html('
  • '); this.uploader.onComplete(null, 'test.jpg', { @@ -597,7 +591,6 @@ describe("app.views.Publisher", function() { context('unsuccessful completion', function() { beforeEach(function() { - Diaspora.I18n.load({ photo_uploader: { completed: '<%= file %> completed' }}); $('#photodropzone').html('
  • '); this.uploader.onComplete(null, 'test.jpg', { diff --git a/spec/javascripts/app/views/stream_post_spec.js b/spec/javascripts/app/views/stream_post_spec.js index 46088809d..d36a95e4a 100644 --- a/spec/javascripts/app/views/stream_post_spec.js +++ b/spec/javascripts/app/views/stream_post_spec.js @@ -53,18 +53,6 @@ describe("app.views.StreamPost", function(){ beforeEach(function(){ loginAs({name: "alice", avatar : {small : "http://avatar.com/photo.jpg"}}); - - Diaspora.I18n.load({stream : { - reshares : { - one : "<%= count %> reshare", - other : "<%= count %> reshares" - }, - likes : { - zero : "<%= count %> Likes", - one : "<%= count %> Like", - other : "<%= count %> Likes" - } - }}); }); context("reshares", function(){ diff --git a/spec/javascripts/helpers/i18n_spec.js b/spec/javascripts/helpers/i18n_spec.js index 17a469611..79dfabe27 100644 --- a/spec/javascripts/helpers/i18n_spec.js +++ b/spec/javascripts/helpers/i18n_spec.js @@ -24,6 +24,10 @@ describe("Diaspora.I18n", function() { Diaspora.I18n.reset(); // run tests with clean locale }); + afterEach(function() { + Diaspora.I18n.load(spec.defaultLocale, "en"); // leave the tests with the default locale + }); + describe("::load", function() { it("sets the class's locale variable", function() { Diaspora.I18n.load(locale, "en", locale); @@ -65,8 +69,10 @@ describe("Diaspora.I18n", function() { expect(translation).toEqual("it works!"); }); - it("returns an empty string if the translation is not found", function() { - expect(Diaspora.I18n.t("missing.locale")).toEqual(""); + it("throws an error if the translation is not found", function() { + expect(function() { + return Diaspora.I18n.t("missing.locale"); + }).toThrowError("Missing translation: missing.locale"); }); it("falls back on missing key", function() { diff --git a/spec/javascripts/jasmine_helpers/SpecHelper.js b/spec/javascripts/jasmine_helpers/SpecHelper.js index 1ac822017..531675210 100644 --- a/spec/javascripts/jasmine_helpers/SpecHelper.js +++ b/spec/javascripts/jasmine_helpers/SpecHelper.js @@ -37,7 +37,6 @@ var customMatchers = { } }; - beforeEach(function() { jasmine.clock().install(); jasmine.Ajax.install(); @@ -52,8 +51,6 @@ beforeEach(function() { var Page = Diaspora.Pages["TestPage"]; $.extend(Page.prototype, Diaspora.EventBroker.extend(Diaspora.BaseWidget)); - Diaspora.I18n.load({}, "en", {}); - Diaspora.page = new Page(); Diaspora.page.publish("page/ready", [$(document.body)]); @@ -74,8 +71,6 @@ beforeEach(function() { }); afterEach(function() { - //spec.clearLiveEventBindings(); - jasmine.clock().uninstall(); jasmine.Ajax.uninstall(); @@ -107,42 +102,6 @@ window.logout = function logout(){ return app.currentUser; }; -window.hipsterIpsumFourParagraphs = "Mcsweeney's mumblecore irony fugiat, ex iphone brunch helvetica eiusmod retro" + - " sustainable mlkshk. Pop-up gentrify velit readymade ad exercitation 3 wolf moon. Vinyl aute laboris artisan irony, " + - "farm-to-table beard. Messenger bag trust fund pork belly commodo tempor street art, nihil excepteur PBR lomo laboris." + - " Cosby sweater american apparel occupy, locavore odio put a bird on it fixie kale chips. Pariatur semiotics flexitarian " + - "veniam, irure freegan irony tempor. Consectetur sriracha pour-over vice, umami exercitation farm-to-table master " + - "cleanse art party." + "\n" + - - "Quinoa nostrud street art helvetica et single-origin coffee, stumptown bushwick selvage skateboard enim godard " + - "before they sold out tumblr. Portland aesthetic freegan pork belly, truffaut occupy assumenda banksy 3 wolf moon " + - "irure forage terry richardson nulla. Anim nostrud selvage sartorial organic. Consequat pariatur aute fugiat qui, " + - "organic marfa sunt gluten-free mcsweeney's elit hella whatever wayfarers. Leggings pariatur chambray, ullamco " + - "flexitarian esse sed iphone pinterest messenger bag Austin cred DIY. Duis enim squid mcsweeney's, nisi lo-fi " + - "sapiente. Small batch vegan thundercats locavore williamsburg, non aesthetic trust fund put a bird on it gluten-free " + - "consectetur." + "\n" + - - "Viral reprehenderit iphone sapiente exercitation. Enim nostrud letterpress, tempor typewriter dreamcatcher tattooed." + - " Ex godard pariatur voluptate est, polaroid hoodie ea nulla umami pickled tempor portland. Nostrud food truck" + - "single-origin coffee skateboard. Fap enim tumblr retro, nihil twee trust fund pinterest non jean shorts veniam " + - "fingerstache small batch. Cred whatever photo booth sed, et dolore gastropub duis freegan. Authentic quis butcher, " + - "fanny pack art party cupidatat readymade semiotics kogi consequat polaroid shoreditch ad four loko." + "\n" + - - "PBR gluten-free ullamco exercitation narwhal in godard occaecat bespoke street art veniam aesthetic jean shorts " + - "mlkshk assumenda. Typewriter terry richardson pork belly, cupidatat tempor craft beer tofu sunt qui gentrify eiusmod " + - "id. Letterpress pitchfork wayfarers, eu sunt lomo helvetica pickled dreamcatcher bicycle rights. Aliqua banksy " + - "cliche, sapiente anim chambray williamsburg vinyl cardigan. Pork belly mcsweeney's anim aliqua. DIY vice portland " + - "thundercats est vegan etsy, gastropub helvetica aliqua. Artisan jean shorts american apparel duis esse trust fund."; - -spec.clearLiveEventBindings = function() { - var events = jQuery.data(document, "events"); - for (var prop in events) { - if(events.hasOwnProperty(prop)) { - delete events[prop]; - } - } -}; - spec.content = function() { return $("#jasmine_content"); }; @@ -195,6 +154,8 @@ spec.retrieveFixture = function(fixtureName) { return xhr.responseText; }; - spec.loadFixtureCount = 0; spec.cachedFixtures = {}; + +spec.defaultLocale = JSON.parse(spec.readFixture("locale_en_javascripts_json")); +Diaspora.I18n.reset(spec.defaultLocale); diff --git a/spec/javascripts/jasmine_helpers/factory.js b/spec/javascripts/jasmine_helpers/factory.js index 052317ba5..bdacc17de 100644 --- a/spec/javascripts/jasmine_helpers/factory.js +++ b/spec/javascripts/jasmine_helpers/factory.js @@ -211,6 +211,24 @@ var factory = { window.gon = { preloads: {} }; _.extend(window.gon.preloads, defaults, overrides); + }, + + pod: function(overrides) { + var defaultAttrs = { + "id": 4, + "host": "pod.example.org", + "port": null, + "ssl": true, + "status": "no_errors", + "checked_at": "2020-01-01T13:37:00.000Z", + "response_time": 100, + "offline": false, + "offline_since": null, + "created_at": "2010-01-01T13:37:00.000Z", + "software": "diaspora 1.2.3.0", + "error": "ConnectionTester::Failure: #" + }; + return new app.models.Pod(_.extend(defaultAttrs, overrides)); } }; diff --git a/spec/lib/i18n_interpolation_fallbacks_spec.rb b/spec/lib/i18n_interpolation_fallbacks_spec.rb index d8569b05a..436d5fa1e 100644 --- a/spec/lib/i18n_interpolation_fallbacks_spec.rb +++ b/spec/lib/i18n_interpolation_fallbacks_spec.rb @@ -15,15 +15,15 @@ describe "i18n interpolation fallbacks" do end describe "when string requires interpolation arguments" do context "current locale has no fallbacks" do - # ago: "%{time} ago" (in en.yml) + # tags.show.follow: "Follow #%{tag}" (in en.yml) it "returns the translation when all arguments are provided" do - expect(I18n.t('ago', :time => "2 months")).to eq("2 months ago") + expect(I18n.t("tags.show.follow", tag: "cats")).to eq("Follow #cats") end it "returns the translation without substitution when all arguments are omitted" do - expect(I18n.t('ago')).to eq("%{time} ago") + expect(I18n.t("tags.show.follow")).to eq("Follow #%{tag}") end it "raises a MissingInterpolationArgument when arguments are wrong" do - expect { I18n.t('ago', :not_time => "2 months") }.to raise_exception(I18n::MissingInterpolationArgument) + expect { I18n.t("tags.show.follow", not_tag: "cats") }.to raise_exception(I18n::MissingInterpolationArgument) end end context "current locale falls back to English" do diff --git a/spec/support/fixture_generation.rb b/spec/support/fixture_generation.rb index b952f145b..3f3496c42 100644 --- a/spec/support/fixture_generation.rb +++ b/spec/support/fixture_generation.rb @@ -44,3 +44,6 @@ RSpec::Rails::ControllerExampleGroup.class_eval do include JasmineFixtureGeneration end +RSpec::Rails::HelperExampleGroup.class_eval do + include JasmineFixtureGeneration +end