-endpointBase = "http://api.c4w.jp/api/v1/"
-getEndpoint = (key) -> "#{endpointBase}#{key}.json"
+ENDPOINT_BASE = "http://api.c4w.jp/api/v1/"
+DEFAULT_LANG = 'ja'
+FALLBACK_LANG = 'en'
+LANGUAGE_LABELS =
+    ja: '日本語'
+    en: 'English'
+
+getEndpoint = (key) -> "#{ENDPOINT_BASE}#{key}.json"
 
 app = angular.module 'disaster-information-client', [
     'pascalprecht.translate'

                                entry.date = new Date(rawDate).toLocaleDateString()
                                entry.time = new Date(rawDate).toLocaleTimeString()
                                entry.body = entry.body # need sanitization?
                                entry.locale = locale
                        deferred.resolve entries
                        return deferred.promise


    '$rootScope'
    (acquireLocales, acquireEntries, $rootScope) ->
        # setting
        $rootScope.languageLabel = LANGUAGE_LABELS
        $rootScope.err = false

        acquireLocales()
            .then (locales) ->
                $rootScope.locales = locales
                $rootScope.selectedLocale = DEFAULT_LANG
                $rootScope.entries = []
                return locales

